From patchwork Mon Sep 7 14:12:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wang Hai X-Patchwork-Id: 261395 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 21FCAC43461 for ; Mon, 7 Sep 2020 17:14:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E44BC215A4 for ; Mon, 7 Sep 2020 17:14:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730490AbgIGRO2 (ORCPT ); Mon, 7 Sep 2020 13:14:28 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:52550 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729772AbgIGOO4 (ORCPT ); Mon, 7 Sep 2020 10:14:56 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 97629845ECC8F70CA9D2; Mon, 7 Sep 2020 22:14:46 +0800 (CST) Received: from huawei.com (10.175.113.133) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Mon, 7 Sep 2020 22:14:43 +0800 From: Wang Hai To: , , , , , , CC: , Subject: [PATCH net-next] net: ethernet: dnet: Remove set but unused variable 'len' Date: Mon, 7 Sep 2020 22:12:07 +0800 Message-ID: <20200907141207.11778-1-wanghai38@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.175.113.133] X-CFilter-Loop: Reflected Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Fixes gcc '-Wunused-but-set-variable' warning: drivers/net/ethernet/dnet.c: In function dnet_start_xmit drivers/net/ethernet/dnet.c:511:15: warning: variable ‘len’ set but not used [-Wunused-but-set-variable] commit 4796417417a6 ("dnet: Dave DNET ethernet controller driver (updated)") involved this unused variable, remove it. Reported-by: Hulk Robot Signed-off-by: Wang Hai --- drivers/net/ethernet/dnet.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/ethernet/dnet.c b/drivers/net/ethernet/dnet.c index db98274501a0..3143df9a398c 100644 --- a/drivers/net/ethernet/dnet.c +++ b/drivers/net/ethernet/dnet.c @@ -508,7 +508,7 @@ static netdev_tx_t dnet_start_xmit(struct sk_buff *skb, struct net_device *dev) struct dnet *bp = netdev_priv(dev); u32 tx_status, irq_enable; - unsigned int len, i, tx_cmd, wrsz; + unsigned int i, tx_cmd, wrsz; unsigned long flags; unsigned int *bufp; @@ -518,9 +518,6 @@ static netdev_tx_t dnet_start_xmit(struct sk_buff *skb, struct net_device *dev) skb->len, skb->head, skb->data); dnet_print_skb(skb); - /* frame size (words) */ - len = (skb->len + 3) >> 2; - spin_lock_irqsave(&bp->lock, flags); tx_status = dnet_readl(bp, TX_STATUS);