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: 101606 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp3190788qge; Tue, 25 Oct 2016 08:54:57 -0700 (PDT) X-Received: by 10.98.130.11 with SMTP id w11mr41422694pfd.101.1477410897514; Tue, 25 Oct 2016 08:54:57 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r5si21319957pgj.125.2016.10.25.08.54.56; Tue, 25 Oct 2016 08:54:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759374AbcJYPyx (ORCPT + 27 others); Tue, 25 Oct 2016 11:54:53 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:54809 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759301AbcJYPyu (ORCPT ); Tue, 25 Oct 2016 11:54:50 -0400 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 Cc: Arnd Bergmann , Alasdair Kergon , dm-devel@redhat.com, Shaohua Li , Mikulas Patocka , Joe Thornber , linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] dm block manager: use do/while(0) for empty macros Date: Tue, 25 Oct 2016 17:54:10 +0200 Message-Id: <20161025155434.21727-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.9.0 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 */