From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 750BD26B2C for ; Wed, 26 Jul 2023 14:07:17 +0000 (UTC) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75C0F2D71 for ; 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 20230726140713euoutp02bc19bc28b8abc3814e3a67c8261f8fd1~1cAxBAxZH1609016090euoutp02L for ; Wed, 26 Jul 2023 14:07:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20230726140713euoutp02bc19bc28b8abc3814e3a67c8261f8fd1~1cAxBAxZH1609016090euoutp02L 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 To: mcgrof@kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: willy@infradead.org, keescook@chromium.org, josh@joshtriplett.org, Joel Granados , 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> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrGKsWRmVeSW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D5N5Z1jadPzat97wbJ8Ov4OqlBtrVMOzpsAcsWuWDru1njywZk5IDTVI zqlxCgrki0zQ9fh84LuO2JW1C7esqnO8oDjlshJLcUaioRZzUXEiAIPY8mk1AwAA X-CMS-MailID: 20230726140712eucas1p1bc7b2d150482936d974ceba9c51d7bc4 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> 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 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 --- 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, -- 2.30.2