Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp27377rwb; Fri, 16 Sep 2022 23:40:12 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7bR1d5C4zcH3xSq4JicDJIq4YDkpZncaFklfBryjcKynfrQssKHXvti7hnepM7uMRyUzLy X-Received: by 2002:a17:906:847b:b0:773:db0f:d533 with SMTP id hx27-20020a170906847b00b00773db0fd533mr5862965ejc.0.1663396812158; Fri, 16 Sep 2022 23:40:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663396812; cv=none; d=google.com; s=arc-20160816; b=TZOQBW5QDCJ17G7+sgnBPCNs2qYYRtQHI38G3HYNU4ElrwgaSKS7zxR2yTzhj2iELx xjuKOaJrJCB1D1TBnaPcVBzwsgX4waNCCWTlkhdJ/2+YNPBgVeShaE9AsX8vtgVuHsYN IEIb9LxiHZnFXP2Y6L6arqWknWCrstuC4CcuGc0t3ICiVxImFF0RKdXa1zQpDXnhVhv7 96bnzht5Te7L1cXlb+g5BB4mcHc93WHq7tebuYTE4JY8WDiKKN8UP8SyumF4CUDJuNlC vb6wyBJ8wEq5YgEBoTZynIQaoiLtRpVtKFEYkhw7DW3iCnAHBvL//4jPOLGa6naB40zw 9FyQ== 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:cc:to:from:dkim-signature; bh=Lgdgq/H/nA5I76joSevima0XH/B50fVoyAmtV+SUmos=; b=Es/pbsHpYHOXKUUmF6bPo8697sGO9qjHC8gLQzJc45e24b0OqDNDohjJi8vAMo0yn6 OLmrSEUasDFoYC3mlY76y/zJ1QRCxHYBfaTcSMDmRJojJJ4M7Goop3uFwTahNzd59ygv nMy/T96xe7A9JPlFHN1DwyBw3NcrkUc5q33jBNI4/pFjlzWCcOKSHdp7bSi35UNWKqaX q6KCZJwtXvwrNAmjOp6KRK0nJ0rNLRfx5hN4qIBhigzYtYKzlMW3e9ORfTk1bhiuwul/ FYtwwAapgs8k3FnVugR184Jdo80XbeODh8ep7rEcdEQffprjwlyZQM1ycDd/L/9AP4QF HaMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=FgI44wAC; 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=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c4-20020a1709060fc400b007807e613e5bsi3707512ejk.933.2022.09.16.23.39.46; Fri, 16 Sep 2022 23:40:12 -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; dkim=pass header.i=@163.com header.s=s110527 header.b=FgI44wAC; 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=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229454AbiIQGbJ (ORCPT + 99 others); Sat, 17 Sep 2022 02:31:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229452AbiIQGbG (ORCPT ); Sat, 17 Sep 2022 02:31:06 -0400 Received: from mail-m974.mail.163.com (mail-m974.mail.163.com [123.126.97.4]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 518FD4A117; Fri, 16 Sep 2022 23:31:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=Lgdgq /H/nA5I76joSevima0XH/B50fVoyAmtV+SUmos=; b=FgI44wACuIF23ZEdhRjuu TSNhgHbTPeyVCN9Aj0deZgfG6huDrXm4oeQuPx08tmZhywKLUzaK2F5DnR858P0t BcdXDst+4AelDhibTdAUM18kvYEFcQqr0N7q6Zq50W7YJN9QTSWfLi/1P63p9zrf U8kYYkT3mDhmNb305JgOZY= Received: from DESKTOP-CE2KKHI.localdomain (unknown [124.160.210.227]) by smtp4 (Coremail) with SMTP id HNxpCgDHeN+KaSVjeUn+dg--.624S2; Sat, 17 Sep 2022 14:30:35 +0800 (CST) From: williamsukatube@163.com To: 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 Cc: William Dean Subject: [PATCH -next] nexthop: simplify code in nh_valid_get_bucket_req Date: Sat, 17 Sep 2022 14:30:31 +0800 Message-Id: <20220917063031.2172-1-williamsukatube@163.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: HNxpCgDHeN+KaSVjeUn+dg--.624S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7GFWkWw1UKrWUtr45uFykXwb_yoW3Arg_Gr n7XrZrXrsFqFyfCw4UCF45Aa4xKr4ruFWrua92qa97Ja47AFsY9w4kGF98CrZ7WrWkGry7 WF1fKrWjyF9rZjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xR_8nY3UUUUU== X-Originating-IP: [124.160.210.227] X-CM-SenderInfo: xzlozx5dpv3yxdwxuvi6rwjhhfrp/xtbBiAt-g1aECq0k2gAAs0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 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); - if (err) - return err; - - return 0; } /* rtnl */ -- 2.25.1