Message ID | 20221117145820.2898968-1-luwei32@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp410007wrr; Thu, 17 Nov 2022 05:54:51 -0800 (PST) X-Google-Smtp-Source: AA0mqf7v+dxS44kraLr70IgcATAfdCWJ9dEC+YWV7/m50eKPQ3guTxu6mq2gXGW2z3XAKVWx7M9f X-Received: by 2002:aa7:d904:0:b0:460:41e2:b84f with SMTP id a4-20020aa7d904000000b0046041e2b84fmr2267195edr.188.1668693291228; Thu, 17 Nov 2022 05:54:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668693291; cv=none; d=google.com; s=arc-20160816; b=lIvrx9OtLmws9w1eO9ZZqU7A0Ckq3PWtGSo5tlfAuS1GarJlcf4mpnW0jPsipINyT3 E4I33X/hm7gPe1UBKRShQ+ugyCZ5QlZ0zyZdEhAEDplyZZpAZZG+x87H5SmuShLrqGC4 /2O9F3YJECOgDTSqSQcMCvf1PrTnfIu3shLXmR9WHbsu6ic9h+CmojFSrMjWFKNzPjs0 oVNkg1394jzJAx8F6nBh3CYSZU4kBhebrhmxTW7GoTbwFix9EKIPQCjIX2TSoyCbrPMb 6+cFvmYGFQGFeVs/GulojYSwQs+sEOVP40AWFFNk1w2A+RYLeZroUQHJwW3ZejY75y7w HbRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from; bh=f3BQjm65hjLLU6fGk4k+MfSIyJ4PyVlpKGfkm8XTuDc=; b=qoXaaeuRDnrXW9h8tiTU+J6g747l5dxI2oqkAvbArbfaiJOUAjBPDgBjKbcBzIL2gr ftt/9mNFr9t0EYc6yMd4Nx0ia3F5yRKKBD9VHdqA8flTbL6PQn4ClTE9L8qaj/dzOXvQ tK4/i4k6bLdnSpHcIvReFNAHVo+DblwFSgjy0IfEe+xkLOo8Dfytyxj0Zu3dx7rGLzFc rJ8JopiHhoBjWeaHRl/uLiQuRAeHm47cX02s12pQZVJuYd4kiry9EDZuafjGwgZHGO/R ejy9RSDZn2CHHQoWHOpvaqlAHeCOV4P70r3BuZFRJ+12vTpuSAnpA5gD6I1ofy2SElhP Jp/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d11-20020a17090694cb00b007ae1052554esi534936ejy.898.2022.11.17.05.54.27; Thu, 17 Nov 2022 05:54:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240218AbiKQNxq (ORCPT <rfc822;a1648639935@gmail.com> + 99 others); Thu, 17 Nov 2022 08:53:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240211AbiKQNxl (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 17 Nov 2022 08:53:41 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D63E11805; Thu, 17 Nov 2022 05:53:37 -0800 (PST) Received: from kwepemi500015.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NChFh0tmLzmVvV; Thu, 17 Nov 2022 21:53:12 +0800 (CST) Received: from huawei.com (10.175.101.6) by kwepemi500015.china.huawei.com (7.221.188.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 17 Nov 2022 21:53:35 +0800 From: Lu Wei <luwei32@huawei.com> To: <davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>, <lars.povlsen@microchip.com>, <Steen.Hegelund@microchip.com>, <daniel.machon@microchip.com>, <UNGLinuxDriver@microchip.com>, <netdev@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, <linux-kernel@vger.kernel.org> Subject: [patch net-next] net: microchip: sparx5: remove useless code in sparx5_qos_init() Date: Thu, 17 Nov 2022 22:58:20 +0800 Message-ID: <20221117145820.2898968-1-luwei32@huawei.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemi500015.china.huawei.com (7.221.188.92) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749751736624541233?= X-GMAIL-MSGID: =?utf-8?q?1749751736624541233?= |
Series |
[net-next] net: microchip: sparx5: remove useless code in sparx5_qos_init()
|
|
Commit Message
Lu Wei
Nov. 17, 2022, 2:58 p.m. UTC
There is no need to define variable ret, so remove it
and return sparx5_leak_groups_init() directly.
Signed-off-by: Lu Wei <luwei32@huawei.com>
---
drivers/net/ethernet/microchip/sparx5/sparx5_qos.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
Comments
On Thu, Nov 17, 2022 at 10:58:20PM +0800, Lu Wei wrote: > There is no need to define variable ret, so remove it > and return sparx5_leak_groups_init() directly. > > Signed-off-by: Lu Wei <luwei32@huawei.com> > --- > drivers/net/ethernet/microchip/sparx5/sparx5_qos.c | 8 +------- > 1 file changed, 1 insertion(+), 7 deletions(-) > > diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c b/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c > index 1e79d0ef0cb8..2f39300d52cc 100644 > --- a/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c > +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c > @@ -383,13 +383,7 @@ static int sparx5_leak_groups_init(struct sparx5 *sparx5) > > int sparx5_qos_init(struct sparx5 *sparx5) > { > - int ret; > - > - ret = sparx5_leak_groups_init(sparx5); > - if (ret < 0) > - return ret; > - > - return 0; > + return sparx5_leak_groups_init(sparx5); > } Does sparx5_qos_init() even make sense given that all it does it call a function? Please don't do the minimum needed to make your robot happy. Think about the code, the change, is this the best fix? Andrew
Den Thu, Nov 17, 2022 at 10:58:20PM +0800 skrev Lu Wei: > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe > > There is no need to define variable ret, so remove it > and return sparx5_leak_groups_init() directly. > > Signed-off-by: Lu Wei <luwei32@huawei.com> > --- > drivers/net/ethernet/microchip/sparx5/sparx5_qos.c | 8 +------- > 1 file changed, 1 insertion(+), 7 deletions(-) > > diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c b/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c > index 1e79d0ef0cb8..2f39300d52cc 100644 > --- a/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c > +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c > @@ -383,13 +383,7 @@ static int sparx5_leak_groups_init(struct sparx5 *sparx5) > > int sparx5_qos_init(struct sparx5 *sparx5) > { > - int ret; > - > - ret = sparx5_leak_groups_init(sparx5); > - if (ret < 0) > - return ret; > - > - return 0; > + return sparx5_leak_groups_init(sparx5); > } > > int sparx5_tc_mqprio_add(struct net_device *ndev, u8 num_tc) > -- > 2.31.1 > sparx5_qos_init() will be expanded in later patch series, as new QoS features require new initializations - so this is actually somewhat intentional. / Daniel
> sparx5_qos_init() will be expanded in later patch series, as new QoS > features require new initializations - so this is actually somewhat > intentional. When do you expect such patches to land? If it going to be soon, we can keep the code as it is. If it is going to be a while, the bots are going to keep finding this and what to remove it. Andrew
Den Thu, Nov 17, 2022 at 09:14:38PM +0100 skrev Andrew Lunn: > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe > > > sparx5_qos_init() will be expanded in later patch series, as new QoS > > features require new initializations - so this is actually somewhat > > intentional. > > When do you expect such patches to land? Most likely sometime in the next window. > > If it going to be soon, we can keep the code as it is. If it is going > to be a while, the bots are going to keep finding this and what to > remove it. I see. If bots will be bugging us regularly, then it might just be best to let the patch through. > > Andrew / Daniel
diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c b/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c index 1e79d0ef0cb8..2f39300d52cc 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c @@ -383,13 +383,7 @@ static int sparx5_leak_groups_init(struct sparx5 *sparx5) int sparx5_qos_init(struct sparx5 *sparx5) { - int ret; - - ret = sparx5_leak_groups_init(sparx5); - if (ret < 0) - return ret; - - return 0; + return sparx5_leak_groups_init(sparx5); } int sparx5_tc_mqprio_add(struct net_device *ndev, u8 num_tc)