From patchwork Tue Oct 25 15:54:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9394937 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5880B60762 for ; Tue, 25 Oct 2016 15:57:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B92129671 for ; Tue, 25 Oct 2016 15:57:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4020B2967E; Tue, 25 Oct 2016 15:57:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com [209.132.183.39]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A087829671 for ; Tue, 25 Oct 2016 15:57:12 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9PFsjEv027937; Tue, 25 Oct 2016 11:54:45 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u9PFshZE023700 for ; Tue, 25 Oct 2016 11:54:43 -0400 Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9PFshT3024045 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 25 Oct 2016 11:54:43 -0400 Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.75]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 34A9ABAF8; Tue, 25 Oct 2016 15:54:42 +0000 (UTC) Received: from wuerfel.lan. ([78.43.20.153]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0M57wk-1cqNKC0Y5W-00zJFV; Tue, 25 Oct 2016 17:54:38 +0200 From: Arnd Bergmann To: Mike Snitzer Date: Tue, 25 Oct 2016 17:54:10 +0200 Message-Id: <20161025155434.21727-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K0:B06KvxVHlHMZAOaknsRTMHL2N4tGC1wwLbDt34YJi1Yd7QdG9OS Wym4GSIR2yrnw5RxuTKY3lE7Uyxxor+Ea8US03UmTerCiIogzr/6fNLXIYyNWgePjOSm3P5 av9CmjsGdziTj2xXtENgTpbSajfZEh3T6Igu7ICcEGxIhyFxARu4ykOt7fnMRw2fqXFw5/u DPVMU0CyCEF4n8zdWaoWg== X-UI-Out-Filterresults: notjunk:1; V01:K0:qKOlf7uAk40=:f/7GFvW+4fyRz8O27dTCxP V7cHofPdde37spBRgQeibrL5lR23iMMglZILhKRHutIK29PsyqF78p8cmA5JuEv0H4gIqdwfX 3bT8ghkcOqkBAkbQWBVrG/F8/r0O1A4GcWEhRknpIHLNJQLMeiJsEMgNIagMx/Jkogx0Pulsx w0FtgHJlOj2VDk2ZRYezWS8CzMVa8iHfzeCdHx+CtF4o6PLRJUaPVRlV4Nc/cVWQPPpJFLglH S9rBlLOieKysEfHgx85c8n+ULMn+tawrwR6UH1cTGRdTrX6t4R+kaq7VqqStNEM1lMSPnX13c yL0u0QqkGzo9MDncBf2K9ox4owKNM2eygvgfTTC0zfOv/S2e/qp+TiaAuV+j5asmps7cmO13Q woG50FNf9bCEU6AlGtxrK/rT+Se8NU5zP1Dziyh24aGXUIQqZpGMZxia903/HGyXM5R0UaOND +Ny1r1O2jgk2VLBHdZguJo15PjKCNq8vEWuBT7pbrzTKRUKPadFikhghruXiP0aP6Lh3dgbCp 7GVGjKPboI2wnabEW/gAzj4rFV7YXMa+1XrM5/Uq4QQ0YUqamHVUinv3UgZEalXuqTDjAPXTI s8v0oQCwLyaPlgjwkO8rUZm2/3EDuDqodKibQbud160oJjadbVH9anFgUsHei/YUYKiNE+h7l n04E0M91AReT9464rWxy8G03BoWsBqv1J5DoSlyhihDGXwL5nNY6GOirTJ6CgeERu8vY0Pcfl Fy/wTEavXH8PisVr X-Greylist: Sender IP whitelisted by DNSRBL, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 25 Oct 2016 15:54:42 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 25 Oct 2016 15:54:42 +0000 (UTC) for IP:'217.72.192.75' DOMAIN:'mout.kundenserver.de' HELO:'mout.kundenserver.de' FROM:'arnd@arndb.de' RCPT:'' X-RedHat-Spam-Score: 0.789 (BAYES_50, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2) 217.72.192.75 mout.kundenserver.de 217.72.192.75 mout.kundenserver.de X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-loop: dm-devel@redhat.com Cc: Arnd Bergmann , Joe Thornber , linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, dm-devel@redhat.com, Mikulas Patocka , Shaohua Li , Alasdair Kergon Subject: [dm-devel] [PATCH] dm block manager: use do/while(0) for empty macros X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Virus-Scanned: ClamAV using ClamSMTP make W=1 reports a new warning for the dm-block-manager: drivers/md/persistent-data/dm-block-manager.c: In function ‘dm_bm_unlock’: drivers/md/persistent-data/dm-block-manager.c:598:3: error: suggest braces around empty body in an ‘else’ statement [-Werror=empty-body] This is completely harmless, but generally speaking it's a good idea to address this warning as it can often detect nasty bugs, and replacing empty macros with "do { } while (0)" is generally considered good style to make code more robust anyway. Fixes: f94bdb2e26b6 ("dm block manager: make block locking optional") Signed-off-by: Arnd Bergmann --- drivers/md/persistent-data/dm-block-manager.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/md/persistent-data/dm-block-manager.c b/drivers/md/persistent-data/dm-block-manager.c index b619c383d88d..a6dde7cab458 100644 --- a/drivers/md/persistent-data/dm-block-manager.c +++ b/drivers/md/persistent-data/dm-block-manager.c @@ -306,13 +306,13 @@ static void report_recursive_bug(dm_block_t b, int r) #else /* !CONFIG_DM_DEBUG_BLOCK_MANAGER_LOCKING */ -#define bl_init(x) +#define bl_init(x) do { } while (0) #define bl_down_read(x) 0 #define bl_down_read_nonblock(x) 0 -#define bl_up_read(x) +#define bl_up_read(x) do { } while (0) #define bl_down_write(x) 0 -#define bl_up_write(x) -#define report_recursive_bug(x, y) +#define bl_up_write(x) do { } while (0) +#define report_recursive_bug(x, y) do { } while (0) #endif /* CONFIG_DM_DEBUG_BLOCK_MANAGER_LOCKING */