From patchwork Tue Nov 10 03:02:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Lunn X-Patchwork-Id: 11892993 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 47EB1C5517A for ; Tue, 10 Nov 2020 03:03:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0C8BD2067B for ; Tue, 10 Nov 2020 03:03:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731316AbgKJDDY (ORCPT ); Mon, 9 Nov 2020 22:03:24 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:44914 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729452AbgKJDDK (ORCPT ); Mon, 9 Nov 2020 22:03:10 -0500 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kcJw3-006D8X-Un; Tue, 10 Nov 2020 04:03:07 +0100 From: Andrew Lunn To: Jakub Kicinski Cc: netdev , Nicolas Pitre , Andrew Lunn Subject: [PATCH v3 net-next 1/7] drivers: net: smc91x: Fix set but unused W=1 warning Date: Tue, 10 Nov 2020 04:02:42 +0100 Message-Id: <20201110030248.1480413-2-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/smc91x.c:706:51: warning: variable ‘pkt_len’ set but not used [-Wunused-but-set-variable] 706 | unsigned int saved_packet, packet_no, tx_status, pkt_len; The read of the packet length in the descriptor probably needs to be kept in order to keep the hardware happy. So tell the compiler we don't expect to use the value by using the __always_unused attribute. Signed-off-by: Andrew Lunn --- drivers/net/ethernet/smsc/smc91x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c index f6b73afd1879..c8dabeaab4fc 100644 --- a/drivers/net/ethernet/smsc/smc91x.c +++ b/drivers/net/ethernet/smsc/smc91x.c @@ -703,7 +703,8 @@ static void smc_tx(struct net_device *dev) { struct smc_local *lp = netdev_priv(dev); void __iomem *ioaddr = lp->base; - unsigned int saved_packet, packet_no, tx_status, pkt_len; + unsigned int saved_packet, packet_no, tx_status; + unsigned int pkt_len __always_unused; DBG(3, dev, "%s\n", __func__);