From mboxrd@z Thu Jan 1 00:00:00 1970 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=-6.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 E769AC43461 for ; Sun, 13 Sep 2020 21:33:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9BEBC221EF for ; Sun, 13 Sep 2020 21:33:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725969AbgIMVdP (ORCPT ); Sun, 13 Sep 2020 17:33:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725939AbgIMVdM (ORCPT ); Sun, 13 Sep 2020 17:33:12 -0400 Received: from shards.monkeyblade.net (shards.monkeyblade.net [IPv6:2620:137:e000::1:9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 334DDC06174A; Sun, 13 Sep 2020 14:33:11 -0700 (PDT) Received: from localhost (unknown [IPv6:2601:601:9f00:477::3d5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id C6BBA12814447; Sun, 13 Sep 2020 14:16:22 -0700 (PDT) Date: Sun, 13 Sep 2020 14:33:08 -0700 (PDT) Message-Id: <20200913.143308.2042080994542358655.davem@davemloft.net> To: ttoukan.linux@gmail.com Cc: luojiaxing@huawei.com, kuba@kernel.org, idos@mellanox.com, ogerlitz@mellanox.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linuxarm@huawei.com Subject: Re: [PATCH net-next] net: ethernet: mlx4: Avoid assigning a value to ring_cons but not used it anymore in mlx4_en_xmit() From: David Miller In-Reply-To: References: <1599898095-10712-1-git-send-email-luojiaxing@huawei.com> <20200912.182219.1013721666435098048.davem@davemloft.net> X-Mailer: Mew version 6.8 on Emacs 27.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [2620:137:e000::1:9]); Sun, 13 Sep 2020 14:16:23 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tariq Toukan Date: Sun, 13 Sep 2020 13:12:05 +0300 > > > On 9/13/2020 4:22 AM, David Miller wrote: >> From: Luo Jiaxing >> Date: Sat, 12 Sep 2020 16:08:15 +0800 >> >>> We found a set but not used variable 'ring_cons' in mlx4_en_xmit(), it >>> will >>> cause a warning when build the kernel. And after checking the commit >>> record >>> of this function, we found that it was introduced by a previous patch. >>> >>> So, We delete this redundant assignment code. >>> >>> Fixes: 488a9b48e398 ("net/mlx4_en: Wake TX queues only when there's >>> enough room") >>> >>> Signed-off-by: Luo Jiaxing >> Looks good, applied, thanks. >> > > Hi Luo, > > I didn't get a chance to review it during the weekend. Tariq, what are you even commenting on? Are you responding to this patch which removes a %100 obviously unused variable set, or on the commit mentioned in the Fixes: tag? > The ring_cons local variable is used in line 903: > https://elixir.bootlin.com/linux/v5.9-rc4/source/drivers/net/ethernet/mellanox/mlx4/en_tx.c#L903 He is removing an assignment to ring_cons much later in the function and therefore has no effect on this line. > 1. Your patch causes a degradation to the case when MLX4_EN_PERF_STAT > is defined. This is not true, see above.