From patchwork Mon Mar 22 10:25:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 12154333 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE37DC433E0 for ; Mon, 22 Mar 2021 10:26:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9E50661992 for ; Mon, 22 Mar 2021 10:26:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230087AbhCVK0L (ORCPT ); Mon, 22 Mar 2021 06:26:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:51068 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230118AbhCVKZx (ORCPT ); Mon, 22 Mar 2021 06:25:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5348B6198E; Mon, 22 Mar 2021 10:25:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616408753; bh=Y2Gm2lzUjPtqdTmpCFTNGu0eofrp3F1qO7+4yRpZXeI=; h=From:To:Cc:Subject:Date:From; b=PDkoQjr9uWfM7vXiOzcPbJhDtAC3bxlW2FN3rapr2A8Q5I88fO1JfUvfY0B3Vb0th 092SvZRmqTAFbTFvpNrCcT0OV/1vbMQn4DHlteY5RetAWN1dvX6LdSvz1/KWXOrG7n e5YJWcF8U11Igi1E5Boo0EIHronSBCm76+uhmHtDJhnodRdsE7xZNz7DeIPR6dRZ6W 54KrcM8zRjoVKNy1dvka4f4bOqr+TJwR4Kh3cklaU43x+6thXjsEvyHneLudKqjQPw F5g0CFmM6Z768LK1XK8jl7/nvlk1vsWOfPjojesMP8PiYzMYGilXrlE+E6MwvuVK33 h3YxdbKwgbKUw== From: Arnd Bergmann To: "James E.J. Bottomley" , "Martin K. Petersen" Cc: Arnd Bergmann , YueHaibing , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] aic94xx: avoid -Wempty-body warning Date: Mon, 22 Mar 2021 11:25:43 +0100 Message-Id: <20210322102549.278661-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Arnd Bergmann Building with 'make W=1' shows a harmless -Wempty-body warning: drivers/scsi/aic94xx/aic94xx_init.c: In function 'asd_free_queues': drivers/scsi/aic94xx/aic94xx_init.c:858:62: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 858 | ASD_DPRINTK("Uh-oh! Pending is not empty!\n"); Change the empty ASD_DPRINTK() macro to no_printk(), which avoids this warning and adds format string checking. Signed-off-by: Arnd Bergmann --- drivers/scsi/aic94xx/aic94xx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/aic94xx/aic94xx.h b/drivers/scsi/aic94xx/aic94xx.h index 98978bc199ff..8f24180646c2 100644 --- a/drivers/scsi/aic94xx/aic94xx.h +++ b/drivers/scsi/aic94xx/aic94xx.h @@ -33,7 +33,7 @@ #ifdef ASD_DEBUG #define ASD_DPRINTK asd_printk #else -#define ASD_DPRINTK(fmt, ...) +#define ASD_DPRINTK(fmt, ...) no_printk(fmt, ##__VA_ARGS__) #endif /* 2*ITNL timeout + 1 second */ From patchwork Mon Mar 22 10:25:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 12154335 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35B16C433E2 for ; Mon, 22 Mar 2021 10:26:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F1E9E619A4 for ; Mon, 22 Mar 2021 10:26:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230125AbhCVK0P (ORCPT ); Mon, 22 Mar 2021 06:26:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:51086 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230138AbhCVK0A (ORCPT ); Mon, 22 Mar 2021 06:26:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F12356198F; Mon, 22 Mar 2021 10:25:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616408760; bh=dGYeYvd2IMaLpz/92eRucjW7Pn+8zXubyKFXkBRPJx4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W/vUGanAwOcKNRssfNrcu4aAsR6Uh3CmHH5vt6+NvCJ41TcVXv6d03BziSNlKkS2k vGFBq9Vwa6rgnVH5ldgdMuTAn+MR5uBUJVpvt1NUT6aHcnvnQNeyq3h2Vq/4XHu5US VNJOekwzS400wV68ckC75qM09oG5vWYfc1t7T9b0ZA7j2UoGSH5Hc1f4SQXAILSswC S6c29vkpctkYdyptFIHDCsCjsRMYeQSFT8LgjY5Yinv3fliPPfGlfLLY84ltw2Q9g6 IfVYp4gNm8QwzLLGqqY68iWEUq2zjQnA9d8rcRaKadPp6MwLI/EDIvVNGKz6QiDQOT cnw96gQpU8eVw== From: Arnd Bergmann To: Sathya Prakash , Sreekanth Reddy , Suganath Prabu Subramani Cc: Arnd Bergmann , MPT-FusionLinux.pdl@broadcom.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] scsi: message: fusion: avoid -Wempty-body warnings Date: Mon, 22 Mar 2021 11:25:44 +0100 Message-Id: <20210322102549.278661-2-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210322102549.278661-1-arnd@kernel.org> References: <20210322102549.278661-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Arnd Bergmann There are a couple of warnings in this driver when building with W=1: drivers/message/fusion/mptbase.c: In function 'PrimeIocFifos': drivers/message/fusion/mptbase.c:4608:65: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 4608 | "restoring 64 bit addressing\n", ioc->name)); | ^ drivers/message/fusion/mptbase.c:4633:65: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 4633 | "restoring 64 bit addressing\n", ioc->name)); The macros are slightly suboptimal since are not proper statements. Change both versions to the usual "do { ... } while (0)" style to make them more robust and avoid the warning. Signed-off-by: Arnd Bergmann --- drivers/message/fusion/mptdebug.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/message/fusion/mptdebug.h b/drivers/message/fusion/mptdebug.h index 2205dcab0adb..c281b1359419 100644 --- a/drivers/message/fusion/mptdebug.h +++ b/drivers/message/fusion/mptdebug.h @@ -67,12 +67,13 @@ #ifdef CONFIG_FUSION_LOGGING #define MPT_CHECK_LOGGING(IOC, CMD, BITS) \ -{ \ +do { \ if (IOC->debug_level & BITS) \ CMD; \ -} +} while (0) #else -#define MPT_CHECK_LOGGING(IOC, CMD, BITS) +#define MPT_CHECK_LOGGING(IOC, CMD, BITS) \ +do { } while (0) #endif