From patchwork Sat Oct 31 00:58:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Lunn X-Patchwork-Id: 315927 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.7 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 55581C4742C for ; Sat, 31 Oct 2020 00:58:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 07B6B208B6 for ; Sat, 31 Oct 2020 00:58:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726109AbgJaA6u (ORCPT ); Fri, 30 Oct 2020 20:58:50 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:55894 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725536AbgJaA6s (ORCPT ); Fri, 30 Oct 2020 20:58:48 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kYfEE-004Rqh-Uk; Sat, 31 Oct 2020 01:58:46 +0100 From: Andrew Lunn To: Jakub Kicinski Cc: netdev , Andrew Lunn Subject: [PATCH net-next 1/2] drivers: net: davicom: Fixed unused but set variable with W=1 Date: Sat, 31 Oct 2020 01:58:32 +0100 Message-Id: <20201031005833.1060316-2-andrew@lunn.ch> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201031005833.1060316-1-andrew@lunn.ch> References: <20201031005833.1060316-1-andrew@lunn.ch> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org drivers/net/ethernet/davicom//dm9000.c: In function ‘dm9000_dumpblk_8bit’: drivers/net/ethernet/davicom//dm9000.c:235:6: warning: variable ‘tmp’ set but not used [-Wunused-but-set-variable] The driver needs to read packet data from the device even when the packet is known bad. There is no need to assign the data to a variable during this discard operation. Signed-off-by: Andrew Lunn --- drivers/net/ethernet/davicom/dm9000.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c index 5c6c8c5ec747..3fdc70dab5c1 100644 --- a/drivers/net/ethernet/davicom/dm9000.c +++ b/drivers/net/ethernet/davicom/dm9000.c @@ -232,32 +232,29 @@ static void dm9000_inblk_32bit(void __iomem *reg, void *data, int count) static void dm9000_dumpblk_8bit(void __iomem *reg, int count) { int i; - int tmp; for (i = 0; i < count; i++) - tmp = readb(reg); + readb(reg); } static void dm9000_dumpblk_16bit(void __iomem *reg, int count) { int i; - int tmp; count = (count + 1) >> 1; for (i = 0; i < count; i++) - tmp = readw(reg); + readw(reg); } static void dm9000_dumpblk_32bit(void __iomem *reg, int count) { int i; - int tmp; count = (count + 3) >> 2; for (i = 0; i < count; i++) - tmp = readl(reg); + readl(reg); } /*