Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp516516rwb; Sat, 17 Sep 2022 09:14:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5WnCKAKjZgd7JQiZPU+znPpgv12RJ+jNTBR8j7NHzD0Md7vh3pWCW0/lTQzx1RX1vzbrXG X-Received: by 2002:a17:906:dac3:b0:780:a242:2f14 with SMTP id xi3-20020a170906dac300b00780a2422f14mr5856768ejb.668.1663431290038; Sat, 17 Sep 2022 09:14:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663431290; cv=none; d=google.com; s=arc-20160816; b=WF4dYUz431ramG/fjdtUW1pRNHhmDAQB88ZMvGonC6vxWmWPT/yeH9/SdZMX0YGdhz U8ydgzSM4Kd5ZuSRxUR/hfLPQ4UwSKxDopODmNPFhYBHojyFd4Tq6fpxDeY5cAfS/bsp cl2v+gKj3rJ1XVwtK1t8Lyth0XMzjxTGmJ8IndtBps0gX4iPvbDLBmHbVtdQ6bK03u5Y pidTh7KPyg7s6W4qgYBcMQyHDOGyB22uEfFmUkC3M/u6QhsUfzZrwInNUsvVOPMK9hFY noYn4sa63Pniaw40XRt6XuQmOxE8D6J3Rg+QIQ8svHGVlXf+Owb4vPLeaQ3t6CTPEU0y D0TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id; bh=XqWgEmMbqNvylVMUG8sUD/zPSfw1W8rEOfhok+5CVUA=; b=Vlpolk8vASd7qtd93KxaZDkt56ieOrqysznwKYswR6/Hzbze2Gsi5qYaw5MqfkrcwH mcki2KUQ6/BxSsmKpPtRFWhASWlCr/HmXjzWj0QGy6E81yEddt45c1pVU45H5uFMI6eL 6jUJmBNJYKUmgwV2+H6uA4usF5Z+LlZgnhys+JdMya56cB0zO1Mg3ZqCQsfiNbZyt7XB vxdBVT8U7P5/FxMOdOPDQck48PCrQ6c7pAtVtnY7RxYcX9QJbv76o7qodms7WVJezuXM gyzaAB3jDp3lOx3QgkDfUhWQvStzQ+Qz7x9XVGC+tZfTeAso0Sdxo3Qzb2v1UTn9DuWI 3Vlw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t18-20020a056402525200b00451729caaaesi5900864edd.8.2022.09.17.09.14.24; Sat, 17 Sep 2022 09:14:50 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229518AbiIQQHf (ORCPT + 99 others); Sat, 17 Sep 2022 12:07:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229495AbiIQQHc (ORCPT ); Sat, 17 Sep 2022 12:07:32 -0400 Received: from smtp.smtpout.orange.fr (smtp02.smtpout.orange.fr [80.12.242.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75A242AC54 for ; Sat, 17 Sep 2022 09:07:26 -0700 (PDT) Received: from [192.168.1.18] ([90.11.190.129]) by smtp.orange.fr with ESMTPA id ZaLhoismi94emZaLhoujzK; Sat, 17 Sep 2022 18:07:24 +0200 X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 17 Sep 2022 18:07:24 +0200 X-ME-IP: 90.11.190.129 Message-ID: <70a79b03-c691-3376-e88c-fd742d3e41d7@wanadoo.fr> Date: Sat, 17 Sep 2022 18:07:20 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH -next] nexthop: simplify code in nh_valid_get_bucket_req Content-Language: en-GB To: williamsukatube@163.com, dsahern@kernel.org, davem@davemloft.net, yoshfuji@linux-ipv6.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220917063031.2172-1-williamsukatube@163.com> From: Christophe JAILLET In-Reply-To: <20220917063031.2172-1-williamsukatube@163.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,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: X-Mailing-List: linux-kernel@vger.kernel.org Le 17/09/2022 à 08:30, williamsukatube@163.com a écrit : > From: William Dean > > It could directly return 'nh_valid_get_bucket_req_res_bucket' to simplify code. > > Signed-off-by: William Dean > --- > net/ipv4/nexthop.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c > index 853a75a8fbaf..1556961cf153 100644 > --- a/net/ipv4/nexthop.c > +++ b/net/ipv4/nexthop.c > @@ -3489,12 +3489,8 @@ static int nh_valid_get_bucket_req(const struct nlmsghdr *nlh, > return -EINVAL; > } > > - err = nh_valid_get_bucket_req_res_bucket(tb[NHA_RES_BUCKET], > + return nh_valid_get_bucket_req_res_bucket(tb[NHA_RES_BUCKET], > bucket_index, extack); Nit: there should be 1 additional space to keep alignment. CJ > - if (err) > - return err; > - > - return 0; > } > > /* rtnl */