Message ID | 20230726140635.2059334-14-j.granados@samsung.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a985:0:b0:3e4:2afc:c1 with SMTP id t5csp433464vqo; Wed, 26 Jul 2023 07:14:45 -0700 (PDT) X-Google-Smtp-Source: APBJJlHAU2rtjcoMFOt00SEufeQgabJ5OQz1ekpm0OnyObnEBGyqiA5oT+tR3vAz4xus29/UH08q X-Received: by 2002:a05:6a00:1806:b0:668:852a:ffc4 with SMTP id y6-20020a056a00180600b00668852affc4mr2309543pfa.4.1690380884864; Wed, 26 Jul 2023 07:14:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690380884; cv=none; d=google.com; s=arc-20160816; b=k7b3cgyCtlY2xyolG1gLPd/t/AilAg0PExL0pOVDwonpEbwe9D60QkC/Qyi57H4jRp +ZAmdIy41po1I9oM0EhYKXx5YaU6S8/E2tiEK48eLnKAwOdgx95TYNVHbo6cNZhU++8i glGzbzCdEmIn5TBoxQ8s5m9Y5dav/r2em5a7xKHwFEfWyxX4/DDY03+hYenYzSmOZblR fJLscPvEj91n2aFiKR0o+N9lpu0e4gDpzZwMM410jdP6lC6G1tObas9dWAzOumyzISFq qMk/8KpCoC2GKebNUHZjITAg2cONzhTe+XYtLBB3DdI3JN1dplj7dnRzchWNbBeMUNrH uDrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:content-transfer-encoding :mime-version:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=JW7CP4Fi6G/IV8T1nAiu1rAhykb9tptNcnfn6WjOSE4=; fh=s0LCAyjE8v7Yy1M3FYtJ6KHxO4hssKdOWrmbAZ8ZQBw=; b=PsmxU3ziO/7HYI6olfq94vbm1K5aN777Je+fx6dTQBAfsChRlCrZ3sVIsuaWPhEh+F Icz8PERfoQrHiOHuuGG4kZpbC0sFWR7HX3k/eWDEzE+XGNhBqETX2C+7kZMdK2aprT22 8nq+R4h7wAS/YmI30P3Pwhgctf8CtuS6KbdJbFQjjPjg7aFCJTD3svWb/RqvqL7+KcD5 9RoXyjwg6bBLZCs5jBe5aRi+zjgDHwqbpnNgtqIu8/FBh73qcbU3jtbR37cyXP+9Uh4W nh5bY3kRK42Zs6/z0FK3Q7yoZmPMtOvBLWTDrXYcPPg+/sSvWcng+EO7VZKT4Wk6gkwN MMkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=SPdTn6Kz; 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=samsung.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bv188-20020a632ec5000000b0053f01212571si12486753pgb.257.2023.07.26.07.14.28; Wed, 26 Jul 2023 07:14:44 -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=@samsung.com header.s=mail20170921 header.b=SPdTn6Kz; 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=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234094AbjGZOIx (ORCPT <rfc822;kloczko.tomasz@gmail.com> + 99 others); Wed, 26 Jul 2023 10:08:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234425AbjGZOH4 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 26 Jul 2023 10:07:56 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75B482721 for <linux-kernel@vger.kernel.org>; Wed, 26 Jul 2023 07:07:14 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20230726140713euoutp022a7a318d8523ec94e8bed4d6a439290f~1cAxASY0q1520515205euoutp027 for <linux-kernel@vger.kernel.org>; Wed, 26 Jul 2023 14:07:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20230726140713euoutp022a7a318d8523ec94e8bed4d6a439290f~1cAxASY0q1520515205euoutp027 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1690380433; bh=JW7CP4Fi6G/IV8T1nAiu1rAhykb9tptNcnfn6WjOSE4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SPdTn6KzY3FNTAgMP+RF/FRdbqkmUvfDA0eja1hkvhHVExd1a4wiodJQlGXmeBLfB Yg9HRdmaH9jpZEsLK4EqKQDK1u1MF8Ga6ZPK+46lGOX8j//eRASoTreX4NjQ69dQAj VPZEn78HI2EZtG3U0NsHB2OrdHFuPNxT/lrA02mQ= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20230726140712eucas1p2a55c1427b18503a11470c8e14d66e08c~1cAwusIzF0694406944eucas1p2o; Wed, 26 Jul 2023 14:07:12 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 71.76.37758.09821C46; Wed, 26 Jul 2023 15:07:12 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20230726140712eucas1p1bc7b2d150482936d974ceba9c51d7bc4~1cAwan4r92257522575eucas1p1F; Wed, 26 Jul 2023 14:07:12 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20230726140712eusmtrp2fca45d42ef0d1e8a0b96492448999419~1cAwaFtP52063520635eusmtrp2O; Wed, 26 Jul 2023 14:07:12 +0000 (GMT) X-AuditID: cbfec7f5-7ffff7000002937e-3a-64c1289048fb Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 61.67.14344.09821C46; Wed, 26 Jul 2023 15:07:12 +0100 (BST) Received: from localhost (unknown [106.210.248.223]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20230726140712eusmtip2f0fe322b3296998b4ab61e5f2597cf0a~1cAwPqTnT3059730597eusmtip2s; Wed, 26 Jul 2023 14:07:12 +0000 (GMT) From: Joel Granados <j.granados@samsung.com> To: mcgrof@kernel.org, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com> Cc: willy@infradead.org, keescook@chromium.org, josh@joshtriplett.org, Joel Granados <j.granados@samsung.com>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 13/14] sysctl: SIZE_MAX->ARRAY_SIZE in register_net_sysctl Date: Wed, 26 Jul 2023 16:06:33 +0200 Message-Id: <20230726140635.2059334-14-j.granados@samsung.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230726140635.2059334-1-j.granados@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrGKsWRmVeSWpSXmKPExsWy7djPc7oTNA6mGBy/r2Ux53wLi8XTY4/Y LZbuf8ho8X9BvsWZ7lyLC9v6WC0u75rDZnFjwlNGi2MLxCy+nX7DaPH7xxw2B26P2Q0XWTy2 rLzJ5LFgU6nH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712eucas1p1bc7b2d150482936d974ceba9c51d7bc4 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20230726140712eucas1p1bc7b2d150482936d974ceba9c51d7bc4 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230726140712eucas1p1bc7b2d150482936d974ceba9c51d7bc4 References: <20230726140635.2059334-1-j.granados@samsung.com> <CGME20230726140712eucas1p1bc7b2d150482936d974ceba9c51d7bc4@eucas1p1.samsung.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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: INBOX X-GMAIL-THRID: 1772492826400250196 X-GMAIL-MSGID: 1772492826400250196 |
Series |
[01/14] sysctl: Prefer ctl_table_header in proc_sysctl
|
|
Commit Message
Joel Granados
July 26, 2023, 2:06 p.m. UTC
This is part of the effort to remove the end element (sentinel) from the
ctl_table arrays. Now that all the callers to register_net_sysctl are
actual arrays, we replace SIZE_MAX with ARRAY_SIZE of the table.
Stopping condition continues to be based on both size and procname null
test. This sets things up for when the sentinel element is actually
removed: Before removing sentinel the stopping criteria will be the last
null element. When the sentinel is removed then the (correct) size will
take over.
Signed-off-by: Joel Granados <j.granados@samsung.com>
---
include/net/net_namespace.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index e4e5fe75a281..75dba309e043 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h @@ -470,7 +470,7 @@ void unregister_pernet_device(struct pernet_operations *); struct ctl_table; #define register_net_sysctl(net, path, table) \ - register_net_sysctl_sz(net, path, table, SIZE_MAX) + register_net_sysctl_sz(net, path, table, ARRAY_SIZE(table)) #ifdef CONFIG_SYSCTL int net_sysctl_init(void); struct ctl_table_header *register_net_sysctl_sz(struct net *net, const char *path,