From patchwork Tue Nov 10 03:02:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Lunn X-Patchwork-Id: 11892983 X-Patchwork-Delegate: kuba@kernel.org 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=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 714D9C388F7 for ; Tue, 10 Nov 2020 03:03:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2B6992067B for ; Tue, 10 Nov 2020 03:03:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731002AbgKJDDN (ORCPT ); Mon, 9 Nov 2020 22:03:13 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:44918 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729648AbgKJDDL (ORCPT ); Mon, 9 Nov 2020 22:03:11 -0500 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kcJw4-006D8g-1s; Tue, 10 Nov 2020 04:03:08 +0100 From: Andrew Lunn To: Jakub Kicinski Cc: netdev , Nicolas Pitre , Andrew Lunn Subject: [PATCH v3 net-next 4/7] drivers: net: smc911x: Fix set but unused status because of DBG macro Date: Tue, 10 Nov 2020 04:02:45 +0100 Message-Id: <20201110030248.1480413-5-andrew@lunn.ch> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201110030248.1480413-1-andrew@lunn.ch> References: <20201110030248.1480413-1-andrew@lunn.ch> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org drivers/net/ethernet/smsc/smc911x.c: In function ‘smc911x_timeout’: drivers/net/ethernet/smsc/smc911x.c:1251:6: warning: variable ‘status’ set but not used [-Wunused-but-set-variable] 1251 | int status, mask; The status is read in order to print it via the DBG macro. However, due to the way DBG is disabled, the compiler never sees it being used. Change the DBG macro to actually make use of the passed parameters, and the leave the optimiser to remove the unwanted code inside the while (0). Signed-off-by: Andrew Lunn --- drivers/net/ethernet/smsc/smc911x.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/smsc/smc911x.c b/drivers/net/ethernet/smsc/smc911x.c index 8f748a0c057e..6978050496ac 100644 --- a/drivers/net/ethernet/smsc/smc911x.c +++ b/drivers/net/ethernet/smsc/smc911x.c @@ -102,7 +102,10 @@ MODULE_ALIAS("platform:smc911x"); #define PRINTK(dev, args...) netdev_info(dev, args) #else -#define DBG(n, dev, args...) do { } while (0) +#define DBG(n, dev, args...) \ + while (0) { \ + netdev_dbg(dev, args); \ + } #define PRINTK(dev, args...) netdev_dbg(dev, args) #endif