From patchwork Mon May 15 07:14:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Granados X-Patchwork-Id: 13240890 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56D90C7EE26 for ; Mon, 15 May 2023 07:14:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240614AbjEOHO5 (ORCPT ); Mon, 15 May 2023 03:14:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238046AbjEOHOy (ORCPT ); Mon, 15 May 2023 03:14:54 -0400 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B09F10D0 for ; Mon, 15 May 2023 00:14:51 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20230515071449euoutp0169c7ae168f13c5a41c703af9f093ed49~fP8JpDPdc1812418124euoutp01c for ; Mon, 15 May 2023 07:14:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20230515071449euoutp0169c7ae168f13c5a41c703af9f093ed49~fP8JpDPdc1812418124euoutp01c DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1684134889; bh=VAk6TpM5IbKUpQQhFBk2UGIdnFppAQ7wqb8uoAZJtes=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=f66YVTCPlN0DaQXaZ7ajyLmTl6XlYQBRBi6kCseq//I6Pcj/Jz0Xr77i0IxHg9lLI hzkK6fL1JAn7nlSjXtXPYwQkxyu3H0VIy7XDjYMVmiozz+grv46ptRm0vwcQaleqC8 ve9TnNU4VXju9iEx3zwZyWDtmcIvK7kVmKDeHo4g= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20230515071449eucas1p13f9ff6100ef94d232dbaec876abe4e16~fP8JewOjz1419414194eucas1p1m; Mon, 15 May 2023 07:14:49 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 0C.71.42423.9EBD1646; Mon, 15 May 2023 08:14:49 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20230515071449eucas1p172217753f35fed55c4d2f0a419e258dd~fP8JMgkGj1418614186eucas1p1o; Mon, 15 May 2023 07:14:49 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20230515071449eusmtrp15af38073a005c64773a77ba07a6d3b0a~fP8JL4N8v2274622746eusmtrp1f; Mon, 15 May 2023 07:14:49 +0000 (GMT) X-AuditID: cbfec7f2-a51ff7000002a5b7-8a-6461dbe913b4 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 1D.07.10549.9EBD1646; Mon, 15 May 2023 08:14:49 +0100 (BST) Received: from CAMSVWEXC02.scsc.local (unknown [106.1.227.72]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20230515071449eusmtip2c42180c0ac1a13a187e028aedc62234b~fP8I_nN8T2082520825eusmtip2-; Mon, 15 May 2023 07:14:49 +0000 (GMT) Received: from localhost (106.110.32.133) by CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 15 May 2023 08:14:48 +0100 From: Joel Granados To: CC: Sudip Mukherjee , Iurii Zaikin , Kees Cook , , , Joel Granados Subject: [PATCH 1/6] parport: Move magic number "15" to a define Date: Mon, 15 May 2023 09:14:41 +0200 Message-ID: <20230515071446.2277292-2-j.granados@samsung.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230515071446.2277292-1-j.granados@samsung.com> MIME-Version: 1.0 X-Originating-IP: [106.110.32.133] X-ClientProxiedBy: CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) To CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphleLIzCtJLcpLzFFi42LZduzned2XtxNTDFq/qVuc6c612LP3JIvF 5V1z2CxuTHjKaHHg9BRmi2U7/RzYPGY3XGTx2DnrLrvHgk2lHptWdbJ5fN4kF8AaxWWTkpqT WZZapG+XwJXx61pZwRrOigXLj7E2MN5l72Lk4JAQMJGYvTqii5GLQ0hgBaPEiR3trBDOF0aJ LVOnskM4nxkl2ietZe5i5ATruP93DVRiOaPE0genWeCqGpctZgKpEhLYwiixZCIviM0moCNx /s0dsG4RAXGJE6c3M4I0MAs8ZZSY+68XrEFYwEFiweqbLCA2i4CqxKs/J9hAbF4BW4mjx1sZ IVbLS7Rdnw5mcwrYSazbf5QJokZQ4uTMJ2C9zEA1zVtnM0PYEhIHX7yAOltJ4uubXlYIu1bi 1JZbTCBHSAjc4ZCYcHoCO0TCReL1x9tQRcISr45vgYrLSJye3MMC0TCZUWL/vw/sEM5qRoll jV+ZIKqsJVquPIHqcJSY//4TKySM+SRuvBWEuIhPYtK26cwQYV6JjjahCYwqs5D8MAvJD7OQ /LCAkXkVo3hqaXFuemqxYV5quV5xYm5xaV66XnJ+7iZGYII5/e/4px2Mc1991DvEyMTBeIhR goNZSYS3fWZ8ihBvSmJlVWpRfnxRaU5q8SFGaQ4WJXFebduTyUIC6YklqdmpqQWpRTBZJg5O qQYmj81GDf5+UTNvZew6JzJNg3nilpmL3itaJ62eaim+89GDbWmMPEHKE5j8t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4t4n6wvsitIP3H0hdJb94twEy36/Sae4Osusvqb6KF8OjagrO1+xnfn5uUOzd/7L+D9J 5sf6vcJW1qnuF5Zo6Sel2wZ/Cdmmvmntm4r4Fblf7kR7dosEXOm+bhOp1dd41Xvu0W79CXIq ZhuCGjZVL9GX89f5uVyoiud+bGngnrDyUzKKk2xldvmL2XH1N9X/mac2S+N7fYw+o61x/2b2 DzN5vabvYi7fkJzLZSd3I9ZxReDpYJdv75bN/NASuKjWyDS8WO8Jw4POefXGJxiE3tROvZDf 94Kj5Mu7g4v2cCm2K7EUZyQaajEXFScCAA+kUmFHAwAA X-CMS-MailID: 20230515071449eucas1p172217753f35fed55c4d2f0a419e258dd X-Msg-Generator: CA X-RootMTR: 20230515071449eucas1p172217753f35fed55c4d2f0a419e258dd X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230515071449eucas1p172217753f35fed55c4d2f0a419e258dd References: <20230515071446.2277292-1-j.granados@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Put the size of a parport name behind a define so we can use it in other files. This is a preparation patch to be able to use this size in parport/procfs.c. Signed-off-by: Joel Granados --- drivers/parport/share.c | 2 +- include/linux/parport.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/parport/share.c b/drivers/parport/share.c index 62f8407923d4..2d46b1d4fd69 100644 --- a/drivers/parport/share.c +++ b/drivers/parport/share.c @@ -467,7 +467,7 @@ struct parport *parport_register_port(unsigned long base, int irq, int dma, atomic_set(&tmp->ref_count, 1); INIT_LIST_HEAD(&tmp->full_list); - name = kmalloc(15, GFP_KERNEL); + name = kmalloc(PARPORT_NAME_MAX_LEN, GFP_KERNEL); if (!name) { kfree(tmp); return NULL; diff --git a/include/linux/parport.h b/include/linux/parport.h index a0bc9e0267b7..243c82d7f852 100644 --- a/include/linux/parport.h +++ b/include/linux/parport.h @@ -180,6 +180,8 @@ struct ieee1284_info { struct semaphore irq; }; +#define PARPORT_NAME_MAX_LEN 15 + /* A parallel port */ struct parport { unsigned long base; /* base address */ From patchwork Mon May 15 07:14:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Granados X-Patchwork-Id: 13240891 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8157C77B75 for ; Mon, 15 May 2023 07:15:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240629AbjEOHO7 (ORCPT ); Mon, 15 May 2023 03:14:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239559AbjEOHOy (ORCPT ); Mon, 15 May 2023 03:14:54 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0650E76 for ; Mon, 15 May 2023 00:14:52 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20230515071451euoutp02ebabd84cb2badccc913d513c1155dac6~fP8LC-vej1681316813euoutp02B for ; Mon, 15 May 2023 07:14:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20230515071451euoutp02ebabd84cb2badccc913d513c1155dac6~fP8LC-vej1681316813euoutp02B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1684134891; bh=PDU9jqEs8417s9sxrU7lh3cS+FBJYDs7iRwM4PSqxjk=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=NZvcG6txfKlALnmoGaVSt9TgWjC4sNfXlVEjymrJmfLZjYd3mSP3OWsWHv3JX7adV Cy5aHSw67LOmXoIdjOfmJkyQFT0SKMfNLImZMI1VeKgRX85LPFjvPZltVgV2YkOVUu IbaIoRFeAPtfnuzKSSz8hCgRSj5wEBCkTKVrFvxQ= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20230515071451eucas1p132717dca0137ef15506aa989d1fe48cc~fP8K1UiQL1417814178eucas1p1q; Mon, 15 May 2023 07:14:51 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id BC.71.42423.AEBD1646; Mon, 15 May 2023 08:14:51 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20230515071450eucas1p1625a8639e2b0edf47e41126801d4cbb8~fP8Kf7ZEv0313203132eucas1p1j; Mon, 15 May 2023 07:14:50 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20230515071450eusmtrp2d0828b702e0a9f3c6141673ac46d8aa5~fP8KfIRdp2610526105eusmtrp2H; Mon, 15 May 2023 07:14:50 +0000 (GMT) X-AuditID: cbfec7f2-a51ff7000002a5b7-8e-6461dbea09a9 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id CC.D9.14344.AEBD1646; Mon, 15 May 2023 08:14:50 +0100 (BST) Received: from CAMSVWEXC02.scsc.local (unknown [106.1.227.72]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20230515071450eusmtip19478c10b8a19fdd7ccc945b06d0b0a33~fP8KQPBLz3240832408eusmtip1E; Mon, 15 May 2023 07:14:50 +0000 (GMT) Received: from localhost (106.110.32.133) by CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 15 May 2023 08:14:49 +0100 From: Joel Granados To: CC: Sudip Mukherjee , Iurii Zaikin , Kees Cook , , , Joel Granados Subject: [PATCH 2/6] parport: Remove register_sysctl_table from parport_proc_register Date: Mon, 15 May 2023 09:14:42 +0200 Message-ID: <20230515071446.2277292-3-j.granados@samsung.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230515071446.2277292-1-j.granados@samsung.com> MIME-Version: 1.0 X-Originating-IP: [106.110.32.133] X-ClientProxiedBy: CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) To CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplleLIzCtJLcpLzFFi42LZduzned3XtxNTDGZ9ZbQ4051rsWfvSRaL y7vmsFncmPCU0eLA6SnMFst2+jmwecxuuMjisXPWXXaPBZtKPTat6mTz+LxJLoA1issmJTUn syy1SN8ugSvjxru7bAWTVSo65u5nb2DcIdvFyMkhIWAiceXiR2YQW0hgBaPE5zsCXYxcQPYX Rol1U9exQDifGSV+/n7ACtPx4ctidojEckaJBxPOscNVbX4wmxXC2cIo8XJhPyNIC5uAjsT5 N3fAlogIiEucOL2ZEaSIWeApo8Tcf71MIAlhgXCJ0x/uAXVzcLAIqEocP+gBEuYVsJVo6LgP tVpeou36dLCZnAJ2Euv2H2WCqBGUODnzCQuIzQxU07x1NjOELSFx8MULZoheJYmvb3qh5tRK nNpyiwnkBgmBBxwSp98sZYNIuEjsu7SYEcIWlnh1fAs7hC0j8X/nfKiGyYwS+/99YIdwVjNK LGv8ygRRZS3RcuUJVIejxOr1d9lBvpEQ4JO48VYQ4iI+iUnbpjNDhHklOtqEJjCqzELywywk P8xC8sMCRuZVjOKppcW56anFhnmp5XrFibnFpXnpesn5uZsYgSnm9L/jn3Ywzn31Ue8QIxMH 4yFGCQ5mJRHe9pnxKUK8KYmVValF+fFFpTmpxYcYpTlYlMR5tW1PJgsJpCeWpGanphakFsFk mTg4pRqYnFdqdJ70XW8/14i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t1xdy4d/YTHY7V2asL7f474+P+yHOrfzj6sXD+snkU /03kScI0k4U3BSty11cZaJZO+pLBcWV93g3Go4duznlUw1SZJ7uz/tDnZxkdRqf3+9fF8cxR Pi0uKFLP7zTVO+22x/HZi5ueKnx6sKK+foHP+qX5wf5m57aFuDX/WSqb8SWy4PLNBYfCdkgV PDtiYL9kYiC/a2eQe8zlD2enTDhhb2VY++NoqptIe8Gysr7tlivdA2uCbZ6fmiLGNOvG49Ar Xb/EWe5oqx44eD6zw7Xtfeyb58WCb5uPhjCl9iZzli199FElflVJTn/10wscQsUfjLN/xtis 23ztDtM5S/YUn9ofhjfalFiKMxINtZiLihMBjL9PN0gDAAA= X-CMS-MailID: 20230515071450eucas1p1625a8639e2b0edf47e41126801d4cbb8 X-Msg-Generator: CA X-RootMTR: 20230515071450eucas1p1625a8639e2b0edf47e41126801d4cbb8 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230515071450eucas1p1625a8639e2b0edf47e41126801d4cbb8 References: <20230515071446.2277292-1-j.granados@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org This is part of the general push to deprecate register_sysctl_paths and register_sysctl_table. Register dev/parport/PORTNAME and dev/parport/PORTNAME/devices. Temporary allocation for name is freed at the end of the function. Remove all the struct elements that are no longer used in the parport_device_sysctl_template struct. Add parport specific defines that hide the base path sizes. Signed-off-by: Joel Granados Reviewed-by: Luis Chamberlain --- drivers/parport/procfs.c | 89 +++++++++++++++++++++++++--------------- 1 file changed, 57 insertions(+), 32 deletions(-) diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c index d740eba3c099..53ae5cb98190 100644 --- a/drivers/parport/procfs.c +++ b/drivers/parport/procfs.c @@ -32,6 +32,13 @@ #define PARPORT_MAX_TIMESLICE_VALUE ((unsigned long) HZ) #define PARPORT_MIN_SPINTIME_VALUE 1 #define PARPORT_MAX_SPINTIME_VALUE 1000 +/* + * PARPORT_BASE_* is the size of the known parts of the sysctl path + * in dev/partport/%s/devices/%s. "dev/parport/"(12), "/devices/"(9 + * and null char(1). + */ +#define PARPORT_BASE_PATH_SIZE 13 +#define PARPORT_BASE_DEVICES_PATH_SIZE 22 static int do_active_device(struct ctl_table *table, int write, void *result, size_t *lenp, loff_t *ppos) @@ -260,9 +267,6 @@ struct parport_sysctl_table { struct ctl_table_header *sysctl_header; struct ctl_table vars[12]; struct ctl_table device_dir[2]; - struct ctl_table port_dir[2]; - struct ctl_table parport_dir[2]; - struct ctl_table dev_dir[2]; }; static const struct parport_sysctl_table parport_sysctl_template = { @@ -305,7 +309,6 @@ static const struct parport_sysctl_table parport_sysctl_template = { .mode = 0444, .proc_handler = do_hardware_modes }, - PARPORT_DEVICES_ROOT_DIR, #ifdef CONFIG_PARPORT_1284 { .procname = "autoprobe", @@ -355,18 +358,6 @@ static const struct parport_sysctl_table parport_sysctl_template = { }, {} }, - { - PARPORT_PORT_DIR(NULL), - {} - }, - { - PARPORT_PARPORT_DIR(NULL), - {} - }, - { - PARPORT_DEV_DIR(NULL), - {} - } }; struct parport_device_sysctl_table @@ -477,7 +468,9 @@ parport_default_sysctl_table = { int parport_proc_register(struct parport *port) { struct parport_sysctl_table *t; - int i; + char *tmp_dir_path; + size_t tmp_path_len, port_name_len; + int i, err = 0; t = kmemdup(&parport_sysctl_template, sizeof(*t), GFP_KERNEL); if (t == NULL) @@ -485,28 +478,60 @@ int parport_proc_register(struct parport *port) t->device_dir[0].extra1 = port; - for (i = 0; i < 5; i++) - t->vars[i].extra1 = port; - t->vars[0].data = &port->spintime; - t->vars[5].child = t->device_dir; - - for (i = 0; i < 5; i++) - t->vars[6 + i].extra2 = &port->probe_info[i]; + for (i = 0; i < 5; i++) { + t->vars[i].extra1 = port; + t->vars[5 + i].extra2 = &port->probe_info[i]; + } + + port_name_len = strnlen(port->name, PARPORT_NAME_MAX_LEN); + /* + * Allocate a buffer for two paths: dev/parport/PORT and dev/parport/PORT/devices. + * We calculate for the second as that will give us enough for the first. + */ + tmp_path_len = PARPORT_BASE_DEVICES_PATH_SIZE + port_name_len; + tmp_dir_path = kmalloc(tmp_path_len, GFP_KERNEL); + if (!tmp_dir_path) { + err = -ENOMEM; + goto exit_free_t; + } - t->port_dir[0].procname = port->name; + if (tmp_path_len + <= snprintf(tmp_dir_path, tmp_path_len, "dev/parport/%s/devices", port->name)) { + kfree(tmp_dir_path); + return -ENOENT; + } + if (register_sysctl(tmp_dir_path, t->device_dir) == NULL) + /* + * We keep the original behavior of parport where failure to register + * does not return error. + */ + goto exit_free_tmp_dir_path; - t->port_dir[0].child = t->vars; - t->parport_dir[0].child = t->port_dir; - t->dev_dir[0].child = t->parport_dir; - t->sysctl_header = register_sysctl_table(t->dev_dir); - if (t->sysctl_header == NULL) { - kfree(t); - t = NULL; + tmp_path_len = PARPORT_BASE_PATH_SIZE + port_name_len; + if (tmp_path_len + <= snprintf(tmp_dir_path, tmp_path_len, "dev/parport/%s", port->name)) { + err = -ENOENT; + goto exit_free_tmp_dir_path; } + + t->sysctl_header = register_sysctl(tmp_dir_path, t->vars); + if (t->sysctl_header == NULL) + goto exit_free_tmp_dir_path; + port->sysctl_table = t; + + kfree(tmp_dir_path); return 0; + +exit_free_tmp_dir_path: + kfree(tmp_dir_path); +exit_free_t: + kfree(t); + t = NULL; + return err; + } int parport_proc_unregister(struct parport *port) From patchwork Mon May 15 07:14:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Granados X-Patchwork-Id: 13240892 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BEA10C77B75 for ; Mon, 15 May 2023 07:15:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240657AbjEOHPB (ORCPT ); Mon, 15 May 2023 03:15:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239712AbjEOHOz (ORCPT ); Mon, 15 May 2023 03:14:55 -0400 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24F301706 for ; Mon, 15 May 2023 00:14:54 -0700 (PDT) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20230515071452euoutp0109951fb7830e884d26f7ffe868f6e4b0~fP8MiKquM1728617286euoutp01J for ; Mon, 15 May 2023 07:14:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20230515071452euoutp0109951fb7830e884d26f7ffe868f6e4b0~fP8MiKquM1728617286euoutp01J DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1684134893; bh=pPeOSNpDerzdo/FVgNwvDrLtKcZvo6bRygcnqynFxfQ=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=r9rmFihlVwaRGesybwZCaM4ZInmYHptRYNEbXG5a0U7kiAqFpsCZ8q3/I6tUS54TK 8MSMU3m9wqQ3Jj5lZg5su3gQG2yf66sAwJ0sdyWTYfO7egxmLwY5TCA6N8v4ICyQy0 LnwZd8zlostG/ZU1y9yQwzkR70aTP3amoupWoFY8= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20230515071452eucas1p251025117b061f9d4d3f3c84daa2e17d8~fP8MP6ujt2288622886eucas1p25; Mon, 15 May 2023 07:14:52 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id A5.86.37758.CEBD1646; Mon, 15 May 2023 08:14:52 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20230515071452eucas1p1d535f6636b45c193b6b24fa59ff100a6~fP8L9KcZN0787607876eucas1p1R; Mon, 15 May 2023 07:14:52 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20230515071452eusmtrp13fa7e979424c539e5e5d7d31a9a89e68~fP8L7XKca2273622736eusmtrp1w; Mon, 15 May 2023 07:14:52 +0000 (GMT) X-AuditID: cbfec7f5-815ff7000002937e-d5-6461dbecbde0 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id DE.07.10549.CEBD1646; Mon, 15 May 2023 08:14:52 +0100 (BST) Received: from CAMSVWEXC02.scsc.local (unknown [106.1.227.72]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20230515071452eusmtip18031777c491eae90940c46db488c7711~fP8Lucy-S0864508645eusmtip1q; Mon, 15 May 2023 07:14:52 +0000 (GMT) Received: from localhost (106.110.32.133) by CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 15 May 2023 08:14:51 +0100 From: Joel Granados To: CC: Sudip Mukherjee , Iurii Zaikin , Kees Cook , , , Joel Granados Subject: [PATCH 3/6] parport: Remove register_sysctl_table from parport_device_proc_register Date: Mon, 15 May 2023 09:14:43 +0200 Message-ID: <20230515071446.2277292-4-j.granados@samsung.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230515071446.2277292-1-j.granados@samsung.com> MIME-Version: 1.0 X-Originating-IP: [106.110.32.133] X-ClientProxiedBy: CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) To CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphleLIzCtJLcpLzFFi42LZduznOd03txNTDHZsULY4051rsWfvSRa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X-Msg-Generator: CA X-RootMTR: 20230515071452eucas1p1d535f6636b45c193b6b24fa59ff100a6 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230515071452eucas1p1d535f6636b45c193b6b24fa59ff100a6 References: <20230515071446.2277292-1-j.granados@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org This is part of the general push to deprecate register_sysctl_paths and register_sysctl_table. We use a temp allocation to include both port and device name in proc. Allocated mem is freed at the end. The unused parport_device_sysctl_template struct elements that are not used are removed. Signed-off-by: Joel Granados --- drivers/parport/procfs.c | 57 +++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c index 53ae5cb98190..902547eb045c 100644 --- a/drivers/parport/procfs.c +++ b/drivers/parport/procfs.c @@ -384,6 +384,7 @@ parport_device_sysctl_template = { .extra1 = (void*) &parport_min_timeslice_value, .extra2 = (void*) &parport_max_timeslice_value }, + {} }, { { @@ -394,22 +395,6 @@ parport_device_sysctl_template = { .child = NULL }, {} - }, - { - PARPORT_DEVICES_ROOT_DIR, - {} - }, - { - PARPORT_PORT_DIR(NULL), - {} - }, - { - PARPORT_PARPORT_DIR(NULL), - {} - }, - { - PARPORT_DEV_DIR(NULL), - {} } }; @@ -547,30 +532,54 @@ int parport_proc_unregister(struct parport *port) int parport_device_proc_register(struct pardevice *device) { + int err = 0; struct parport_device_sysctl_table *t; struct parport * port = device->port; + size_t port_name_len, device_name_len, tmp_dir_path_len; + char *tmp_dir_path; t = kmemdup(&parport_device_sysctl_template, sizeof(*t), GFP_KERNEL); if (t == NULL) return -ENOMEM; - t->dev_dir[0].child = t->parport_dir; - t->parport_dir[0].child = t->port_dir; - t->port_dir[0].procname = port->name; - t->port_dir[0].child = t->devices_root_dir; - t->devices_root_dir[0].child = t->device_dir; + port_name_len = strnlen(port->name, PARPORT_NAME_MAX_LEN); + device_name_len = strnlen(device->name, PATH_MAX); + + /* Allocate a buffer for two paths: dev/parport/PORT/devices/DEVICE. */ + tmp_dir_path_len = PARPORT_BASE_DEVICES_PATH_SIZE + port_name_len + device_name_len; + tmp_dir_path = kmalloc(tmp_dir_path_len, GFP_KERNEL); + if (!tmp_dir_path) { + err = -ENOMEM; + goto exit_free_t; + } + + if (tmp_dir_path_len + <= snprintf(tmp_dir_path, tmp_dir_path_len, "dev/parport/%s/devices/%s", + port->name, device->name)) { + err = -ENOENT; + goto exit_free_path; + } - t->device_dir[0].procname = device->name; - t->device_dir[0].child = t->vars; t->vars[0].data = &device->timeslice; - t->sysctl_header = register_sysctl_table(t->dev_dir); + t->sysctl_header = register_sysctl(tmp_dir_path, t->vars); if (t->sysctl_header == NULL) { kfree(t); t = NULL; } device->sysctl_table = t; + + kfree(tmp_dir_path); return 0; + +exit_free_path: + kfree(tmp_dir_path); + +exit_free_t: + kfree(t); + t = NULL; + + return err; } int parport_device_proc_unregister(struct pardevice *device) From patchwork Mon May 15 07:14:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Granados X-Patchwork-Id: 13240893 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A637BC7EE22 for ; Mon, 15 May 2023 07:15:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240700AbjEOHPL (ORCPT ); Mon, 15 May 2023 03:15:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240625AbjEOHO5 (ORCPT ); Mon, 15 May 2023 03:14:57 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A55310D0 for ; Mon, 15 May 2023 00:14:56 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20230515071455euoutp02a0962504203d204e925b9d6f40a7a45d~fP8OdFF-l1751317513euoutp02q for ; Mon, 15 May 2023 07:14:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20230515071455euoutp02a0962504203d204e925b9d6f40a7a45d~fP8OdFF-l1751317513euoutp02q DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1684134895; bh=wOcIDhuiqBxMdQKtjn6oQCYKMuhnFN8tdpIeGEFWguE=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=m8m/MH1DJ0qDwhxr2zJ6IZnzV6E0nFohs6sU5tFe/Kt7Vi5sWok1WpeSOLEVmSvUr NV08DufANDJ6ApuxX7it7WzVBBp5lYniSoKdvz5tZ3QcalWSm/in6arJnOy6XI6nyd syg4fRq3cFC+NABNstcsQEWoc6NMgogTi8yKL8+A= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20230515071454eucas1p13e6c044a4bb6960a4996cd7ac6e48f7e~fP8OMAct00789107891eucas1p1Z; Mon, 15 May 2023 07:14:54 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 5E.71.42423.EEBD1646; Mon, 15 May 2023 08:14:54 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20230515071454eucas1p2ae422c4bad233cd6170dce9e7f8304d9~fP8N5YQIl0188101881eucas1p2b; Mon, 15 May 2023 07:14:54 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20230515071454eusmtrp25e55d254521c96bd2b43c1c6087c1412~fP8N4pi2G2610526105eusmtrp2N; Mon, 15 May 2023 07:14:54 +0000 (GMT) X-AuditID: cbfec7f2-a51ff7000002a5b7-98-6461dbee2da2 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 4E.D9.14344.EEBD1646; Mon, 15 May 2023 08:14:54 +0100 (BST) Received: from CAMSVWEXC02.scsc.local (unknown [106.1.227.72]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20230515071454eusmtip145bbc0b7e77efb759a927071b2b33359~fP8NsEp1f3254032540eusmtip1I; Mon, 15 May 2023 07:14:54 +0000 (GMT) Received: from localhost (106.110.32.133) by CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 15 May 2023 08:14:53 +0100 From: Joel Granados To: CC: Sudip Mukherjee , Iurii Zaikin , Kees Cook , , , Joel Granados Subject: [PATCH 4/6] parport: Remove register_sysctl_table from parport_default_proc_register Date: Mon, 15 May 2023 09:14:44 +0200 Message-ID: <20230515071446.2277292-5-j.granados@samsung.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230515071446.2277292-1-j.granados@samsung.com> MIME-Version: 1.0 X-Originating-IP: [106.110.32.133] X-ClientProxiedBy: CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) To CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplleLIzCtJLcpLzFFi42LZduznOd13txNTDJqXaVqc6c612LP3JIvF 5V1z2CxuTHjKaHHg9BRmi2U7/RzYPGY3XGTx2DnrLrvHgk2lHptWdbJ5fN4kF8AaxWWTkpqT WZZapG+XwJVx58RC5oLZ3BUXP/WwNTAu5+xi5OSQEDCR2LBnBnsXIxeHkMAKRonV/1pZIJwv jBJvdh1khXA+M0rM717NDNPyd+VjJojEckaJ86dWscBVvft0F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LOLkZNDQsBE4u/Kx0xdjFwcQgJLGSV2bP3KDJGQkdj45SorhC0s8edaFxtE0UdG iVvtC6E6tjBK3L18iAmkik1AR+L8mztg3SIC4hInTm9mBCliFnjKKDHz0FOwImGBWInbE78C 2RwcLAKqEnPWGIKEeQVsJdZ3HmCE2CYv0XZ9OpjNKWAnsW7/UbBWIaCa07u2sULUC0qcnPmE BcRmBqpv3jqbGcKWkDj44gXUB0oSX9/0Qn1QK/H57zPGCYwis5C0z0LSPgtJ+wJG5lWMIqml xbnpucVGesWJucWleel6yfm5mxiB8bft2M8tOxhXvvqod4iRiYPxEKMEB7OSCG/7zPgUId6U xMqq1KL8+KLSnNTiQ4ymQG9OZJYSTc4HJoC8knhDMwNTQxMzSwNTSzNjJXFez4KORCGB9MSS 1OzU1ILUIpg+Jg5OqQYmrinODSybJ3T+XrmebZPgh3mij8Jq1j1kv2up+Ej2sM0Tw+9n35yc vtorRHOBlM6q4LeT9ERZuKN+OGZ+PMSu2mT0aEP/6j8vrCpO7Fngvj3C4EWb4wm+2Po5VaxX /3fzfu1Id1gkdPxSwiaBC9Zz5M8/WiAnt0+Tb9JWnne5+8PM9s8U6Q1oOOrK9p9F8vTzuJ+m ScbMJQ/U855emKte/Fm4Kjj/weLcBd/M+VQdPNVTvt3dYJF667b4mpWsL3afkN0T/+Ks6M0P 14w8F91/meEkczkqwWOnXZf+09Q9+y79Vj2c/GhH46EkicW6QiUPQ/fK1EXw56XPMGPyuegf wLjstAeHLvePtBlNHVNalFiKMxINtZiLihMBYJZTp0gDAAA= X-CMS-MailID: 20230515071454eucas1p2ae422c4bad233cd6170dce9e7f8304d9 X-Msg-Generator: CA X-RootMTR: 20230515071454eucas1p2ae422c4bad233cd6170dce9e7f8304d9 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230515071454eucas1p2ae422c4bad233cd6170dce9e7f8304d9 References: <20230515071446.2277292-1-j.granados@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org This is part of the general push to deprecate register_sysctl_paths and register_sysctl_table. Simply change the full path "dev/parport/default" to point to an already existing set of table entries (vars). We also remove the unused elements from parport_default_table. Signed-off-by: Joel Granados --- drivers/parport/procfs.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c index 902547eb045c..56f825fcfae6 100644 --- a/drivers/parport/procfs.c +++ b/drivers/parport/procfs.c @@ -430,22 +430,6 @@ parport_default_sysctl_table = { .extra2 = (void*) &parport_max_spintime_value }, {} - }, - { - { - .procname = "default", - .mode = 0555, - .child = parport_default_sysctl_table.vars - }, - {} - }, - { - PARPORT_PARPORT_DIR(parport_default_sysctl_table.default_dir), - {} - }, - { - PARPORT_DEV_DIR(parport_default_sysctl_table.parport_dir), - {} } }; @@ -598,7 +582,7 @@ static int __init parport_default_proc_register(void) int ret; parport_default_sysctl_table.sysctl_header = - register_sysctl_table(parport_default_sysctl_table.dev_dir); + register_sysctl("dev/parport/default", parport_default_sysctl_table.vars); if (!parport_default_sysctl_table.sysctl_header) return -ENOMEM; ret = parport_bus_init(); From patchwork Mon May 15 07:14:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Granados X-Patchwork-Id: 13240894 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BE0FC77B75 for ; Mon, 15 May 2023 07:15:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239405AbjEOHPO (ORCPT ); Mon, 15 May 2023 03:15:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240646AbjEOHO7 (ORCPT ); Mon, 15 May 2023 03:14:59 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47AF71732 for ; Mon, 15 May 2023 00:14:58 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20230515071457euoutp024cab07f7e4b83d91f58ef4ec11b9026b~fP8QZxjvS1782817828euoutp02f for ; Mon, 15 May 2023 07:14:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20230515071457euoutp024cab07f7e4b83d91f58ef4ec11b9026b~fP8QZxjvS1782817828euoutp02f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1684134897; bh=VFuEoWb1Dy0exlvcNJiwJDdruaCS+52aQEQy5tudvTA=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=JiFee9hz+KP8Fh/s5tpUlVnA27nXki66irZl29Aybv9PFUdoQtuq4dPZ5uHG2ZB/6 m1LZJWGQUWfLxQukOCI/x6uLRxqmFbayk9BBlL9o6EGz3E5TcFCj4t/uYA2dO9OeKw /JfFcnHfWWRf5n9BE0WLWOHeSzOz7WtaWTcX0W1s= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20230515071456eucas1p1032e87fe11d6ea05f069fd476c955295~fP8Pxf85F2871128711eucas1p14; Mon, 15 May 2023 07:14:56 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id BF.71.42423.0FBD1646; Mon, 15 May 2023 08:14:56 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20230515071456eucas1p1e92a011498b7f3ca2e02cdc8f0d39415~fP8PdjBX20316603166eucas1p1k; Mon, 15 May 2023 07:14:56 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20230515071456eusmtrp2266c3fff24ea8edab25772245f77e218~fP8Pc9tza2610526105eusmtrp2P; Mon, 15 May 2023 07:14:56 +0000 (GMT) X-AuditID: cbfec7f2-a3bff7000002a5b7-9d-6461dbf0f4ff Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id FE.D9.14344.FEBD1646; Mon, 15 May 2023 08:14:56 +0100 (BST) Received: from CAMSVWEXC02.scsc.local (unknown [106.1.227.72]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20230515071455eusmtip289abcf3633e673dd8b78232d839902f3~fP8PMOnKJ2243722437eusmtip2I; Mon, 15 May 2023 07:14:55 +0000 (GMT) Received: from localhost (106.110.32.133) by CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 15 May 2023 08:14:54 +0100 From: Joel Granados To: CC: Sudip Mukherjee , Iurii Zaikin , Kees Cook , , , Joel Granados Subject: [PATCH 5/6] parport: Removed sysctl related defines Date: Mon, 15 May 2023 09:14:45 +0200 Message-ID: <20230515071446.2277292-6-j.granados@samsung.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230515071446.2277292-1-j.granados@samsung.com> MIME-Version: 1.0 X-Originating-IP: [106.110.32.133] X-ClientProxiedBy: CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) To CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphleLIzCtJLcpLzFFi42LZduznOd0PtxNTDPY2iFic6c612LP3JIvF 5V1z2CxuTHjKaHHg9BRmi2U7/RzYPGY3XGTx2DnrLrvHgk2lHptWdbJ5fN4kF8AaxWWTkpqT WZZapG+XwJXx9dAp1oKbHBU3OpqZ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ABrlJ5NUX5p SapCRn5xia1StKGFkZ6hpYWekYmlnqGxeayVkamSvp1NSmpOZllqkb5dgl7G10OnWAtuclTc 6GhmbmC8wdbFyMkhIWAisf/7Z8YuRi4OIYGljBKTDhxhgUjISGz8cpUVwhaW+HOtiw2i6COj xMwnf5kgnC2MEhPfnQIbxSagI3H+zR1mEFtEQFzixOnNYGOZBZ4CdRx6ygSSEBawkdj46wc7 iM0ioCrxcd50sBW8ArYS5/rWQt0kL9F2fTojiM0pYCexbv9RsF4hoJrTu7ZB1QtKnJz5BOxU ZqD65q2zmSFsCYmDL14wQ8xRkvj6phfqhVqJz3+fMU5gFJmFpH0WkvZZSNoXMDKvYhRJLS3O Tc8tNtIrTswtLs1L10vOz93ECIzAbcd+btnBuPLVR71DjEwcjIcYJTiYlUR422fGpwjxpiRW VqUW5ccXleakFh9iNAX6cyKzlGhyPjAF5JXEG5oZmBqamFkamFqaGSuJ83oWdCQKCaQnlqRm p6YWpBbB9DFxcEo1MC0KW938SNlh/ryFfFL3jLf3ZNi1HOu18/mv173yaYbW230v+4Lvxrj6 1t+6+eDZ/arfYWmHRP0PK0gvMak6rKB9i8Oyc+bHd2+5as+4b1k5O5y77J/91hTldlMeVuY8 ba3nwXPizzF2xlae1dWWK2d+1sS/+t8vsUbxCaoXE+5OX34wVfzi0f86rj2cU7OZJZcdlonZ tIi5qJ87b+PiYrEFB3+4bj35NZ6PQ65t8rW0V3utd01lD9/Q7Vb0Uzw2bpb36/jlv49tnHim kVP72WJ5QY6UJQf+P3vlsyqp40bnJAb9Ez3+F4Q63BTZ4g480G8//EBZc9vFiyrZ8T9jPd95 Gs+P5F6++0izr8yrCCWW4oxEQy3mouJEAC+FTjtJAwAA X-CMS-MailID: 20230515071456eucas1p1e92a011498b7f3ca2e02cdc8f0d39415 X-Msg-Generator: CA X-RootMTR: 20230515071456eucas1p1e92a011498b7f3ca2e02cdc8f0d39415 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230515071456eucas1p1e92a011498b7f3ca2e02cdc8f0d39415 References: <20230515071446.2277292-1-j.granados@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org The partport driver used to rely on defines to include different directories in sysctl. Now that we have made the transition to register_sysctl from regsiter_sysctl_table, they are no longer needed. Signed-off-by: Joel Granados --- drivers/parport/procfs.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c index 56f825fcfae6..e3f773ea6b4f 100644 --- a/drivers/parport/procfs.c +++ b/drivers/parport/procfs.c @@ -243,13 +243,6 @@ do { \ return 0; } -#define PARPORT_PORT_DIR(CHILD) { .procname = NULL, .mode = 0555, .child = CHILD } -#define PARPORT_PARPORT_DIR(CHILD) { .procname = "parport", \ - .mode = 0555, .child = CHILD } -#define PARPORT_DEV_DIR(CHILD) { .procname = "dev", .mode = 0555, .child = CHILD } -#define PARPORT_DEVICES_ROOT_DIR { .procname = "devices", \ - .mode = 0555, .child = NULL } - static const unsigned long parport_min_timeslice_value = PARPORT_MIN_TIMESLICE_VALUE; From patchwork Mon May 15 07:14:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Granados X-Patchwork-Id: 13240895 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55B80C77B75 for ; Mon, 15 May 2023 07:15:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240734AbjEOHPW (ORCPT ); Mon, 15 May 2023 03:15:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240664AbjEOHPI (ORCPT ); Mon, 15 May 2023 03:15:08 -0400 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1387D198B for ; Mon, 15 May 2023 00:14:59 -0700 (PDT) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20230515071457euoutp01993a6b3be144dd7146e07a884861c2c0~fP8RIG5EC1809018090euoutp01o for ; Mon, 15 May 2023 07:14:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20230515071457euoutp01993a6b3be144dd7146e07a884861c2c0~fP8RIG5EC1809018090euoutp01o DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1684134897; bh=6PBemcNPoWe9oVs56Q8iJPd1Hh6luHfxm8DwLyJDgGA=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=ZaWqW07Bg+uWZaSSIbxTQ0QN5bujAfJiTnt4V0usCZu0r6WS4hyhx3WWrkjdMyasn DF1TGgi3FGjGNU8u7Im+ZvfEsGa2kNEoMpAua/SgFUQ+xHPhlyjhbARKcEffGc4AoT SOspabgzC6zSbJZOgxE/BDA0Ge4Rf5r3livNzod4= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20230515071457eucas1p19dac7057926ec5ad4f74741f5c43f473~fP8Q-HzD00315403154eucas1p1h; Mon, 15 May 2023 07:14:57 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 40.81.42423.1FBD1646; Mon, 15 May 2023 08:14:57 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20230515071457eucas1p105a2dba9f4741cd6fe495bcf527d664d~fP8QsGIES0813608136eucas1p1W; Mon, 15 May 2023 07:14:57 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20230515071457eusmtrp20ea15dfc6cc0842d3b98dee3e17325e5~fP8Qrj6kz2610526105eusmtrp2T; Mon, 15 May 2023 07:14:57 +0000 (GMT) X-AuditID: cbfec7f2-a3bff7000002a5b7-a1-6461dbf112b9 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 20.E9.14344.1FBD1646; Mon, 15 May 2023 08:14:57 +0100 (BST) Received: from CAMSVWEXC02.scsc.local (unknown [106.1.227.72]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20230515071457eusmtip28c38e715b8fe725587302344b7894ca7~fP8QXs6Bf2126721267eusmtip2B; Mon, 15 May 2023 07:14:57 +0000 (GMT) Received: from localhost (106.110.32.133) by CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 15 May 2023 08:14:56 +0100 From: Joel Granados To: CC: Sudip Mukherjee , Iurii Zaikin , Kees Cook , , , Joel Granados Subject: [PATCH 6/6] sysctl: stop exporting register_sysctl_table Date: Mon, 15 May 2023 09:14:46 +0200 Message-ID: <20230515071446.2277292-7-j.granados@samsung.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230515071446.2277292-1-j.granados@samsung.com> MIME-Version: 1.0 X-Originating-IP: [106.110.32.133] X-ClientProxiedBy: CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) To CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplleLIzCtJLcpLzFFi42LZduznOd2PtxNTDJa0a1ic6c612LP3JIvF 5V1z2CxuTHjKaHHg9BRmi2U7/RzYPGY3XGTx2DnrLrvHgk2lHptWdbJ5fN4kF8AaxWWTkpqT WZZapG+XwJXxrvkje8EGyYrrV08yNTCuFe1i5OSQEDCRuHz7ClMX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FkZ6hpYWekYmlnqGxeayVkamSvp1NSmpOZllqkb5dgl7Gu+aP7AUbJCuu Xz3J1MC4VrSLkZNDQsBEYvaKvcxdjFwcQgJLGSXe/N3EApGQkdj45SorhC0s8edaFxtE0UdG iSNHt0M5WxgletpuMoFUsQnoSJx/c4cZxBYREJc4cXozI0gRs8BTRomZh56CFQkLOErcm9gP toJFQFViwfTd7CA2r4CtxPXvS6BWy0u0XZ/OCGJzCthJrNt/FKxXCKjm9K5trBD1ghInZz4B q2cGqm/eOpsZwpaQOPjiBTPEHCWJr296oV6olfj89xnjBEaRWUjaZyFpn4WkfQEj8ypGkdTS 4tz03GIjveLE3OLSvHS95PzcTYzACNx27OeWHYwrX33UO8TIxMF4iFGCg1lJhLd9ZnyKEG9K YmVValF+fFFpTmrxIUZToD8nMkuJJucDU0BeSbyhmYGpoYmZpYGppZmxkjivZ0FHopBAemJJ anZqakFqEUwfEwenVANTyVnrb3ufqZ6XTApIYepJ4VvfXF/60otlRbrU+RuuMrEr/7PF2Uve +Xk4+ezp0zPstommmjqkfvCtu3ZeRIW54Oy27kU/fhT9qi35se3YpIyj6ud3KQbmHt9fnZ7r LPk5Q3WNkuzC3+sSGnlWMUoIcuQsclTNSy+5wOPi8I6tYe/qM21zf9Taa+xmkb/qI2Z36ZfM rz9HcgL/Z71sDjDQSa1f8GRT6eKDXpM2sJVyXtz7imWOWn7CRc4fSicPOn9/tVhWe4mD0tzW zr8MthaJPxuzzyonxrB2e91ct4rrgKn820a2UN+9WpdPs4UJNF2Y/P6rwbOA1Q1qItppm3bO //zLMP3vMv+K3UcreBKUWIozEg21mIuKEwHPFX7DSQMAAA== X-CMS-MailID: 20230515071457eucas1p105a2dba9f4741cd6fe495bcf527d664d X-Msg-Generator: CA X-RootMTR: 20230515071457eucas1p105a2dba9f4741cd6fe495bcf527d664d X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230515071457eucas1p105a2dba9f4741cd6fe495bcf527d664d References: <20230515071446.2277292-1-j.granados@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org We make register_sysctl_table static because the only function calling it is in fs/proc/proc_sysctl.c (__register_sysctl_base). We remove it from the sysctl.h header and modify the documentation in both the header and proc_sysctl.c files to mention "register_sysctl" instead of "register_sysctl_table". Signed-off-by: Joel Granados --- fs/proc/proc_sysctl.c | 5 ++--- include/linux/sysctl.h | 8 +------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 8038833ff5b0..f8f19e000d76 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -1582,7 +1582,7 @@ static int register_leaf_sysctl_tables(const char *path, char *pos, * array. A completely 0 filled entry terminates the table. * We are slowly deprecating this call so avoid its use. */ -struct ctl_table_header *register_sysctl_table(struct ctl_table *table) +static struct ctl_table_header *register_sysctl_table(struct ctl_table *table) { struct ctl_table *ctl_table_arg = table; int nr_subheaders = count_subheaders(table); @@ -1634,7 +1634,6 @@ struct ctl_table_header *register_sysctl_table(struct ctl_table *table) header = NULL; goto out; } -EXPORT_SYMBOL(register_sysctl_table); int __register_sysctl_base(struct ctl_table *base_table) { @@ -1700,7 +1699,7 @@ static void drop_sysctl_table(struct ctl_table_header *header) /** * unregister_sysctl_table - unregister a sysctl table hierarchy - * @header: the header returned from register_sysctl_table + * @header: the header returned from register_sysctl or __register_sysctl_table * * Unregisters the sysctl table and all children. proc entries may not * actually be removed until they are no longer used by anyone. diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 3d08277959af..218e56a26fb0 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -89,7 +89,7 @@ int proc_do_static_key(struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos); /* - * Register a set of sysctl names by calling register_sysctl_table + * Register a set of sysctl names by calling register_sysctl * with an initialised array of struct ctl_table's. An entry with * NULL procname terminates the table. table->de will be * set up by the registration and need not be initialised in advance. @@ -222,7 +222,6 @@ struct ctl_table_header *__register_sysctl_table( struct ctl_table_set *set, const char *path, struct ctl_table *table); struct ctl_table_header *register_sysctl(const char *path, struct ctl_table *table); -struct ctl_table_header *register_sysctl_table(struct ctl_table * table); void unregister_sysctl_table(struct ctl_table_header * table); extern int sysctl_init_bases(void); @@ -257,11 +256,6 @@ static inline int __register_sysctl_base(struct ctl_table *base_table) #define register_sysctl_base(table) __register_sysctl_base(table) -static inline struct ctl_table_header *register_sysctl_table(struct ctl_table * table) -{ - return NULL; -} - static inline void register_sysctl_init(const char *path, struct ctl_table *table) { }