From patchwork Tue May 16 16:28:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Granados X-Patchwork-Id: 13243405 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 1F263C7EE25 for ; Tue, 16 May 2023 16:29:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229487AbjEPQ3k (ORCPT ); Tue, 16 May 2023 12:29:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230206AbjEPQ3j (ORCPT ); Tue, 16 May 2023 12:29:39 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89F1B93D3 for ; Tue, 16 May 2023 09:29:18 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20230516162917euoutp027189aabc2cbc8b155f626d1b91ccd418~frJitncke2601326013euoutp028 for ; Tue, 16 May 2023 16:29:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20230516162917euoutp027189aabc2cbc8b155f626d1b91ccd418~frJitncke2601326013euoutp028 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1684254557; bh=AGwOrjkXnJsShntN6ZdjyKWZaxqN+Gn01iPpEEkziA0=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=AAAjJt7gtjzVj7q0qgovub2EjhB1ebSKwjPHrKx9qfwf0KRVd3RPTM1oSuqII+cEb D1oUHW3qtkNA45/LP245EeFfzou+7i3VyRhs2Mb0rtgk+Phq8qcutKdm0yqcf61brx RRYRKDouTPxy34DM0ricR4OtUCcGd45qCe3V3I2s= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20230516162917eucas1p1377a9c65d25ae3ac438e7f1101481c25~frJibMq8E2072920729eucas1p1p; Tue, 16 May 2023 16:29:17 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id EB.C3.42423.C5FA3646; Tue, 16 May 2023 17:29:16 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20230516162916eucas1p190019c8af454bd55da6da37209f93024~frJiHeDOn2040620406eucas1p1c; Tue, 16 May 2023 16:29:16 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20230516162916eusmtrp13e8f9f3a6137633a2e002b5157df09ec~frJiG3mpj1955419554eusmtrp1h; Tue, 16 May 2023 16:29:16 +0000 (GMT) X-AuditID: cbfec7f2-a3bff7000002a5b7-ae-6463af5ce206 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 8E.47.10549.C5FA3646; Tue, 16 May 2023 17:29:16 +0100 (BST) Received: from CAMSVWEXC02.scsc.local (unknown [106.1.227.72]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20230516162916eusmtip20b36ead6e668e2e4069fe56ae279f381~frJh3lKal2583225832eusmtip25; Tue, 16 May 2023 16:29:16 +0000 (GMT) Received: from localhost (106.210.248.56) by CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 16 May 2023 17:29:15 +0100 From: Joel Granados To: CC: Kees Cook , , Iurii Zaikin , , Sudip Mukherjee , Joel Granados Subject: [PATCH v3 1/6] parport: Move magic number "15" to a define Date: Tue, 16 May 2023 18:28:58 +0200 Message-ID: <20230516162903.3208880-2-j.granados@samsung.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230516162903.3208880-1-j.granados@samsung.com> MIME-Version: 1.0 X-Originating-IP: [106.210.248.56] X-ClientProxiedBy: CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) To CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplleLIzCtJLcpLzFFi42LZduzned2Y9ckpBke/W1mc6c612LP3JIvF 5V1z2CxuTHjKaHHg9BRmi2U7/RzYPGY3XGTx2DnrLrvHgk2lHptWdbJ5fN4kF8AaxWWTkpqT WZZapG+XwJWx7d1WpoL7nBWT5n9ga2Ds5uhi5OSQEDCROPfpAFsXIxeHkMAKRonbh+8xQThf GCV27epnh3A+M0r8v/IHyOEAa/m9NBgivpxRYsmPv4xwRacW/oTq2MIocaNzPxvIEjYBHYnz b+4wg9giAuISJ05vButgFnjKKHFv72qwImEBZ4lTyx6ygtgsAqoS/zdPAWvgFbCVaD8+kwXi WnmJtuvTGUFsTgE7ifdrNjFB1AhKnJz5BKyGGaimeetsZghbQuLgixfMEL1KEu0TH7BC2LUS p7bcAntUQuAOh8SR3pXsEAkXiWdLHzNC2MISr45vgYrLSJye3MMC0TCZUWL/vw/sEM5qRoll jV+ZIKqsJVquPIGGkqPEsznMECafxI23ghAH8UlM2jYdKswr0dEmNIFRZRaSF2YheWEWkhcW MDKvYhRPLS3OTU8tNsxLLdcrTswtLs1L10vOz93ECEwxp/8d/7SDce6rj3qHGJk4GA8xSnAw K4nwBvYlpwjxpiRWVqUW5ccXleakFh9ilOZgURLn1bY9mSwkkJ5YkpqdmlqQWgSTZeLglGpg CvvcX5g7qexMRrDBabu789OePF8QEB3nfrTll10U38MzywvzUpWN5/9sfKV8ynrd6s8+Upqd vn7y9Z/4/3/X+m6x94tx8/kul6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JTpgXbcN7hyzAo+WN3L8cr6dKHbR/CZVz6 u90VLXbkujJkWqkfcp8ifkWK6dUjv2D3ch7FA13SyUelDNJLwuovd8jtOr3op/Uq7kgL5Qgd dn9V1kcM7oVu/oJPxW41BF/+Lfyx2V3w1ZrbrexhrYVCuxNYN3n110ilfjsmt32mZVbwV5db m1snbuPcJGjrcLqapU/wYvCUVj8zpijGQ9N5vqy//O1P93sB8ajAEwKvG+7sncuj/1Cs1rj6 y4pHaxZtf6KyR//MXyWW4oxEQy3mouJEAHqYnt1GAwAA X-CMS-MailID: 20230516162916eucas1p190019c8af454bd55da6da37209f93024 X-Msg-Generator: CA X-RootMTR: 20230516162916eucas1p190019c8af454bd55da6da37209f93024 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230516162916eucas1p190019c8af454bd55da6da37209f93024 References: <20230516162903.3208880-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 Reviewed-by: Luis Chamberlain --- 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 Tue May 16 16:28:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Granados X-Patchwork-Id: 13243406 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 1B5DAC77B7F for ; Tue, 16 May 2023 16:29:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230320AbjEPQ3s (ORCPT ); Tue, 16 May 2023 12:29:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230235AbjEPQ3l (ORCPT ); Tue, 16 May 2023 12:29:41 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DE899EDA for ; Tue, 16 May 2023 09:29:20 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20230516162919euoutp02be92d556990a10246249c486be073005~frJkONhbW2468724687euoutp02J for ; Tue, 16 May 2023 16:29:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20230516162919euoutp02be92d556990a10246249c486be073005~frJkONhbW2468724687euoutp02J DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1684254559; bh=I5QUMQHQyMuHfDAt3DHmxyhsM2ENc2fVzedUE32vBM0=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=e7qfqGqxdqrvY0X2s6m4RLfBmXbBl6vt+NLNopsAn4O0xctdm181LIOL0jqG3mWFO z6ECmuOJinBwjy4rNTMuklqOftW4d2jlw53p19ssVL79N91SlbPe7dLLhthPSuu7za zzQk6Kg+7CIvcuZeHnwQ+ngsw1nUbaGpD67vH2ik= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20230516162918eucas1p1c5a1f8835312bd4863e898001e5b552c~frJkAzC602238322383eucas1p1P; Tue, 16 May 2023 16:29:18 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id F9.A8.37758.E5FA3646; Tue, 16 May 2023 17:29:18 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20230516162918eucas1p155eda7abb5a41fcb82f299698a88db65~frJjv09Vi3099430994eucas1p1I; Tue, 16 May 2023 16:29:18 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20230516162918eusmtrp1d052e2ccf6bf4f8fcb59fa7802ef646c~frJjvSfB21955419554eusmtrp1j; Tue, 16 May 2023 16:29:18 +0000 (GMT) X-AuditID: cbfec7f5-815ff7000002937e-92-6463af5ea1d5 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 6F.47.10549.E5FA3646; Tue, 16 May 2023 17:29:18 +0100 (BST) Received: from CAMSVWEXC02.scsc.local (unknown [106.1.227.72]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20230516162918eusmtip2ee1a399ee43ccb72bd20ffae6a9ff6c7~frJjl4aIO2307723077eusmtip2j; Tue, 16 May 2023 16:29:18 +0000 (GMT) Received: from localhost (106.210.248.56) by CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 16 May 2023 17:29:17 +0100 From: Joel Granados To: CC: Kees Cook , , Iurii Zaikin , , Sudip Mukherjee , Joel Granados Subject: [PATCH v3 2/6] parport: Remove register_sysctl_table from parport_proc_register Date: Tue, 16 May 2023 18:28:59 +0200 Message-ID: <20230516162903.3208880-3-j.granados@samsung.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230516162903.3208880-1-j.granados@samsung.com> MIME-Version: 1.0 X-Originating-IP: [106.210.248.56] X-ClientProxiedBy: CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) To CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnleLIzCtJLcpLzFFi42LZduznOd249ckpBmfma1uc6c612LP3JIvF 5V1z2CxuTHjKaHHg9BRmi2U7/RzYPGY3XGTx2DnrLrvHgk2lHptWdbJ5fN4kF8AaxWWTkpqT WZZapG+XwJWxfcsLloIz6hWzN/5na2Dcq9DFyMkhIWAicWrTSpYuRi4OIYEVjBIv395ghnC+ MEr0vu1ih3A+M0osPvSBCabl396DrBCJ5YwSO7t/scBVre34BNWyhVHiwvM+dpAWNgEdifNv 7jCD2CIC4hInTm9mBCliFnjKKHFv72o2kISwQJTE2Z5XrCA2i4CqxM+Xj8CaeQVsJfqa57JB 7JaXaLs+nRHE5hSwk3i/ZhMTRI2gxMmZT1hAbGagmuats5khbAmJgy9eMEP0Kkm0T3zACmHX SpzacosJ5AgJgQccErf33Yd6zkWi/ehSRghbWOLV8S3sELaMxOnJPSwQDZMZJfb/+8AO4axm lFjW+BWq21qi5coTqA5Hif3L1wGdzQFk80nceCsIcRGfxKRt05khwrwSHW1CExhVZiH5YRaS H2Yh+WEBI/MqRvHU0uLc9NRi47zUcr3ixNzi0rx0veT83E2MwDRz+t/xrzsYV7z6qHeIkYmD 8RCjBAezkghvYF9yihBvSmJlVWpRfnxRaU5q8SFGaQ4WJXFebduTyUIC6YklqdmpqQWpRTBZ Jg5OqQamrSaq9+Q9Ht28eybDdXWlwOdGBt33rkrbND8zmoUaOqce9cn6kMN7tfiKt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I4Zdeu9KR1gjdk9uT41jr1L5IyuL2gR+n1hUlzuGardhomNZw4IbPE t21OzJ+3Xk+d16n8E5UWtV35hN+5Y2bDK7mIbJ8J3xMdBP/u97Jb+ds6rVhGPvD6opqUvIZj sRdiug8dPfytuWmO2RPWr64We77rnhW1V2a9Wnx5nVCxnWcr5/eCjEg1udWzZu8xrojvbn5U p/ltYc2xzH9nEjh0ow/fPn/3qDhrSuU+Le1ouZdZUmzf15dx2tfl5ExNy5u45Nohzp0Fyud2 2b38p/llLU9E76ewE1+UWIozEg21mIuKEwEnyB2RRwMAAA== X-CMS-MailID: 20230516162918eucas1p155eda7abb5a41fcb82f299698a88db65 X-Msg-Generator: CA X-RootMTR: 20230516162918eucas1p155eda7abb5a41fcb82f299698a88db65 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230516162918eucas1p155eda7abb5a41fcb82f299698a88db65 References: <20230516162903.3208880-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. To make sure the resulting directory structure did not change we made sure that `find /proc/sys/dev/ | sha1sum` was the same before and after the change. Signed-off-by: Joel Granados Reported-by: kernel test robot Closes: https://lore.kernel.org/r/202305150948.pHgIh7Ql-lkp@intel.com/ Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202305150948.pHgIh7Ql-lkp@intel.com/ Reviewed-by: Luis Chamberlain --- drivers/parport/procfs.c | 88 +++++++++++++++++++++++++--------------- 1 file changed, 56 insertions(+), 32 deletions(-) diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c index d740eba3c099..02c52de6e640 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 @@ -473,11 +464,12 @@ 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 bytes_written, i, err = 0; t = kmemdup(&parport_sysctl_template, sizeof(*t), GFP_KERNEL); if (t == NULL) @@ -485,28 +477,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]; + } - t->port_dir[0].procname = port->name; + 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 = kzalloc(tmp_path_len, GFP_KERNEL); + if (!tmp_dir_path) { + err = -ENOMEM; + goto exit_free_t; + } - t->port_dir[0].child = t->vars; - t->parport_dir[0].child = t->port_dir; - t->dev_dir[0].child = t->parport_dir; + bytes_written = snprintf(tmp_dir_path, tmp_path_len, + "dev/parport/%s/devices", port->name); + if (tmp_path_len <= bytes_written) { + err = -ENOENT; + goto exit_free_tmp_dir_path; + } + if (register_sysctl(tmp_dir_path, t->device_dir) == NULL) { + err = -ENOENT; + goto exit_free_tmp_dir_path; + } - t->sysctl_header = register_sysctl_table(t->dev_dir); + tmp_path_len = PARPORT_BASE_PATH_SIZE + port_name_len; + bytes_written = snprintf(tmp_dir_path, tmp_path_len, + "dev/parport/%s", port->name); + if (tmp_path_len <= bytes_written) { + err = -ENOENT; + goto exit_free_tmp_dir_path; + } + + t->sysctl_header = register_sysctl(tmp_dir_path, t->vars); if (t->sysctl_header == NULL) { - kfree(t); - t = NULL; + err = -ENOENT; + 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); + return err; } int parport_proc_unregister(struct parport *port) From patchwork Tue May 16 16:29:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Granados X-Patchwork-Id: 13243407 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 3147FC77B7F for ; Tue, 16 May 2023 16:30:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230388AbjEPQ3u (ORCPT ); Tue, 16 May 2023 12:29:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230206AbjEPQ3m (ORCPT ); Tue, 16 May 2023 12:29:42 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6C911BCD for ; Tue, 16 May 2023 09:29:22 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20230516162921euoutp026e1d2d78bc386a991c9ca625a062bc02~frJmXm2Dm2772727727euoutp02a for ; Tue, 16 May 2023 16:29:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20230516162921euoutp026e1d2d78bc386a991c9ca625a062bc02~frJmXm2Dm2772727727euoutp02a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1684254561; bh=CjqRXAToz0uQhFB7WWJPv1LFocOxn4EdbByLvmL1pCg=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=jHcsE7RlRqRyc1IC+bNY9meFWObVv4QpRQYLPT3KKMyh93ZggAv3+zumSHuGHjIU8 fyxaR87mlajAEi7ldEt1LkhS3qT1cpBFO6uGb2Mu1JXTJhzPyIPWggLXNDJodx7uQG Wy0Sx/6fIirnF9UtqcdgnT3coZGq8iyLaJAp8Ek0= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20230516162921eucas1p2164dd6a56618c37a4aae1ad0d0c0ecf9~frJmOGBNV2230122301eucas1p2i; Tue, 16 May 2023 16:29:21 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 22.FF.35386.16FA3646; Tue, 16 May 2023 17:29:21 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20230516162920eucas1p124a6d49b54e72998eb7be57ff9d17c8a~frJleNpJw2040720407eucas1p17; Tue, 16 May 2023 16:29:20 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20230516162920eusmtrp1e9ca749058287e081294fcefd9ec79bc~frJldwd8P2056220562eusmtrp1E; Tue, 16 May 2023 16:29:20 +0000 (GMT) X-AuditID: cbfec7f4-cdfff70000028a3a-4a-6463af612e47 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 61.57.10549.06FA3646; Tue, 16 May 2023 17:29:20 +0100 (BST) Received: from CAMSVWEXC02.scsc.local (unknown [106.1.227.72]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20230516162920eusmtip16916338117813cb97c6be51139fe89cd~frJlTc_8B1297312973eusmtip1F; Tue, 16 May 2023 16:29:20 +0000 (GMT) Received: from localhost (106.210.248.56) by CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 16 May 2023 17:29:19 +0100 From: Joel Granados To: CC: Kees Cook , , Iurii Zaikin , , Sudip Mukherjee , Joel Granados Subject: [PATCH v3 3/6] parport: Remove register_sysctl_table from parport_device_proc_register Date: Tue, 16 May 2023 18:29:00 +0200 Message-ID: <20230516162903.3208880-4-j.granados@samsung.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230516162903.3208880-1-j.granados@samsung.com> MIME-Version: 1.0 X-Originating-IP: [106.210.248.56] X-ClientProxiedBy: CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01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T2RNhaHzAc/X7k92bezw r7W6bLo5piSnLC5nuRJLcUaioRZzUXEiAHGKkGtHAwAA X-CMS-MailID: 20230516162920eucas1p124a6d49b54e72998eb7be57ff9d17c8a X-Msg-Generator: CA X-RootMTR: 20230516162920eucas1p124a6d49b54e72998eb7be57ff9d17c8a X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230516162920eucas1p124a6d49b54e72998eb7be57ff9d17c8a References: <20230516162903.3208880-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 Reported-by: kernel test robot Closes: https://lore.kernel.org/r/202305150948.pHgIh7Ql-lkp@intel.com/ Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202305150948.pHgIh7Ql-lkp@intel.com/ Reviewed-by: Luis Chamberlain --- drivers/parport/procfs.c | 56 +++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c index 02c52de6e640..a2b58da1fe86 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), - {} } }; @@ -546,30 +531,53 @@ int parport_proc_unregister(struct parport *port) int parport_device_proc_register(struct pardevice *device) { + int bytes_written, 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 = kzalloc(tmp_dir_path_len, GFP_KERNEL); + if (!tmp_dir_path) { + err = -ENOMEM; + goto exit_free_t; + } + + bytes_written = snprintf(tmp_dir_path, tmp_dir_path_len, "dev/parport/%s/devices/%s", + port->name, device->name); + if (tmp_dir_path_len <= bytes_written) { + 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); + + return err; } int parport_device_proc_unregister(struct pardevice *device) From patchwork Tue May 16 16:29:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Granados X-Patchwork-Id: 13243408 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 6355CC7EE2A for ; Tue, 16 May 2023 16:30:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230455AbjEPQ3v (ORCPT ); Tue, 16 May 2023 12:29:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230257AbjEPQ3r (ORCPT ); Tue, 16 May 2023 12:29:47 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B09E77A93 for ; Tue, 16 May 2023 09:29:24 -0700 (PDT) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20230516162923euoutp02301b72bd5f5ef5ffb0ee46344b849e64~frJodt8lR2992529925euoutp02G for ; Tue, 16 May 2023 16:29:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20230516162923euoutp02301b72bd5f5ef5ffb0ee46344b849e64~frJodt8lR2992529925euoutp02G DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1684254563; bh=QM3sFZtH85rPrt7SJ5H3ajJQOzrfaGGNgWXGdQTwHFg=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=JM0wBmoQbaXizCQJTdFgUE/1FIYdjMPrEqkzWSl2hxr3rOSk3daWyQuU8o780RZhb LcAEagI5PhK5Ha+0g2C/f+wGCeLQBpdI+bDjMslx4SkUrMBbXh86B10i0PXX6Z2eV3 nuMo53tcBCdjIESnIK8NDPbRHSfaLfp4Dx8eLL0Y= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20230516162923eucas1p2ed66575c00c8648b61e44c055c689f71~frJoUIByf1671116711eucas1p2s; Tue, 16 May 2023 16:29:23 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id B2.FF.35386.36FA3646; Tue, 16 May 2023 17:29:23 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20230516162923eucas1p17af1b1f69261818fc7a5b0ccc17ab6d3~frJn-OIbo2072920729eucas1p1x; Tue, 16 May 2023 16:29:23 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20230516162923eusmtrp1750348386b3201d2f62aa03c79acb38a~frJn_xMCR2056220562eusmtrp1F; Tue, 16 May 2023 16:29:23 +0000 (GMT) X-AuditID: cbfec7f4-cc9ff70000028a3a-4f-6463af638f02 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id D1.57.10549.26FA3646; Tue, 16 May 2023 17:29:23 +0100 (BST) Received: from CAMSVWEXC02.scsc.local (unknown [106.1.227.72]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20230516162922eusmtip168a2fd7639206b5420e32dd95669193c~frJn2EBNe0589205892eusmtip1y; Tue, 16 May 2023 16:29:22 +0000 (GMT) Received: from localhost (106.210.248.56) by CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 16 May 2023 17:29:22 +0100 From: Joel Granados To: CC: Kees Cook , , Iurii Zaikin , , Sudip Mukherjee , Joel Granados Subject: [PATCH v3 4/6] parport: Remove register_sysctl_table from parport_default_proc_register Date: Tue, 16 May 2023 18:29:01 +0200 Message-ID: <20230516162903.3208880-5-j.granados@samsung.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230516162903.3208880-1-j.granados@samsung.com> MIME-Version: 1.0 X-Originating-IP: [106.210.248.56] X-ClientProxiedBy: CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) To CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) X-Brightmail-Tracker: H4sIAAAAAA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SS3FGoqEWc1FxIgAlHIsNRwMAAA== X-CMS-MailID: 20230516162923eucas1p17af1b1f69261818fc7a5b0ccc17ab6d3 X-Msg-Generator: CA X-RootMTR: 20230516162923eucas1p17af1b1f69261818fc7a5b0ccc17ab6d3 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230516162923eucas1p17af1b1f69261818fc7a5b0ccc17ab6d3 References: <20230516162903.3208880-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. To make sure the resulting directory structure did not change we made sure that `find /proc/sys/dev/ | sha1sum` was the same before and after the change. Signed-off-by: Joel Granados Reviewed-by: Luis Chamberlain --- 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 a2b58da1fe86..5a58a7852464 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), - {} } }; @@ -596,7 +580,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 Tue May 16 16:29:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Granados X-Patchwork-Id: 13243410 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 B9853C7EE25 for ; Tue, 16 May 2023 16:30:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230262AbjEPQay (ORCPT ); Tue, 16 May 2023 12:30:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230475AbjEPQ3v (ORCPT ); Tue, 16 May 2023 12:29:51 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 999207EE1 for ; Tue, 16 May 2023 09:29:38 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20230516162926euoutp0291659828d55938d695a847f4afad2fee~frJqunMDC2992529925euoutp02H for ; Tue, 16 May 2023 16:29:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20230516162926euoutp0291659828d55938d695a847f4afad2fee~frJqunMDC2992529925euoutp02H DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1684254566; bh=Uighe2MJl9yCP9/daoYtGOQ9P01aVBh946aqBbx2U6o=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=GnZQ+fpKbYmO9psOZUljI6jzW1HogCxpi1KxB/CSpC/y1T/DXxi4eSEtZ22zj9ixl EcS2YqSaxHIEM1vBh9wf0wbVG2xNWQEclSXPmMOoZpZhfROIE/JX+Z06o8YylLICcD z4L+awvz3MVeTLhavRnKjuPANTh8SM+8aa+u9hIE= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20230516162925eucas1p2ba41bba44aaf1d50540463cc05ed866f~frJqh23Nk1677416774eucas1p2y; Tue, 16 May 2023 16:29:25 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 4F.C3.42423.56FA3646; Tue, 16 May 2023 17:29:25 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20230516162924eucas1p210b95df5fd4229aeaa5cb41d6d873f3d~frJpep6b_1671116711eucas1p2u; Tue, 16 May 2023 16:29:24 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20230516162924eusmtrp1e9c208a93cae3a4e19486cee9a86e8e0~frJpeISpr2056220562eusmtrp1G; Tue, 16 May 2023 16:29:24 +0000 (GMT) X-AuditID: cbfec7f2-a51ff7000002a5b7-c1-6463af65a6f6 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 62.57.10549.46FA3646; Tue, 16 May 2023 17:29:24 +0100 (BST) Received: from CAMSVWEXC02.scsc.local (unknown [106.1.227.72]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20230516162924eusmtip1879164ba7cfddefcb079a7c5106882d0~frJpTzmpT2290922909eusmtip1i; Tue, 16 May 2023 16:29:24 +0000 (GMT) Received: from localhost (106.210.248.56) by CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 16 May 2023 17:29:23 +0100 From: Joel Granados To: CC: Kees Cook , , Iurii Zaikin , , Sudip Mukherjee , Joel Granados Subject: [PATCH v3 5/6] parport: Removed sysctl related defines Date: Tue, 16 May 2023 18:29:02 +0200 Message-ID: <20230516162903.3208880-6-j.granados@samsung.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230516162903.3208880-1-j.granados@samsung.com> MIME-Version: 1.0 X-Originating-IP: [106.210.248.56] X-ClientProxiedBy: CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) To CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphleLIzCtJLcpLzFFi42LZduzned3U9ckpBvMmaVmc6c612LP3JIvF 5V1z2CxuTHjKaHHg9BRmi2U7/RzYPGY3XGTx2DnrLrvHgk2lHptWdbJ5fN4kF8AaxWWTkpqT WZZapG+XwJUxpXUqa0EPZ8WiZ72MDYxt7F2MnBwSAiYSm0/PZASxhQRWMEqcWh7bxcgFZH9h lDh7eBUzhPOZUWLnrZNwHY37v7JAJJYzSqxs2IZQ1fLzGjuEs4VRoqv3JlgLm4COxPk3d5hB bBEBcYkTpzczghQxCzxllLi3dzVbFyMHh7CAvcTx26YgJouAqsSBTQUg5bwCthJvD/YzQWyW l2i7Ph3sVk4BO4n3azYxQdQISpyc+YQFxGYGqmneOpsZwpaQOPjiBTNEr5JE+8QHrBB2rcSp LbeYQE6QELjDIdH09AtUwkXi06IVbBC2sMSr41ugXpaROD25hwWiYTKjxP5/H9ghnNWMEssa v0KdZy3RcuUJVIejxJtnu9lBvpEQ4JO48VYQ4iI+iUnbpjNDhHklOtqEJjCqzELywywkP8xC 8sMCRuZVjOKppcW56anFhnmp5XrFibnFpXnpesn5uZsYgQnm9L/jn3Ywzn31Ue8QIxMH4yFG CQ5mJRHewL7kFCHelMTKqtSi/Pii0pzU4kOM0hwsSuK82rYnk4UE0hNLUrNTUwtSi2CyTByc Ug1Mc1mTFqxaYH/iwobgA2fYi2cHy6ft9XnpXPEs5KZ8ps8czegrjeo3l6y6dLzB20aZJT5e ak3oNPEt96pu+e7Q0vp9XJBzlbF44JELN1j+LpohceKMJ9/ZozvES95M2cNT1aPLw3/5Nu/X dUyaWhcf9TeGKuqvqI9JNdzVONdjh/MDlwjWYmnzzJ43adpGWarn58+Vtrrw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Ees0/WNN2ykSi6mhDM2mop7bzjW6srzWvzVEoeA+0rtboG7j7KXZF/glns9Uc2z Kj70xnKj2Q2ObixT8t0uZ0WxhudWzj5/1DbfVZwndPPboFes+9K0lGz9OJRipdaUxeY6BrZO e/LjWqfV2iimXumLSizFGYmGWsxFxYkAOR9bR0UDAAA= X-CMS-MailID: 20230516162924eucas1p210b95df5fd4229aeaa5cb41d6d873f3d X-Msg-Generator: CA X-RootMTR: 20230516162924eucas1p210b95df5fd4229aeaa5cb41d6d873f3d X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230516162924eucas1p210b95df5fd4229aeaa5cb41d6d873f3d References: <20230516162903.3208880-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 Reviewed-by: Luis Chamberlain --- drivers/parport/procfs.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c index 5a58a7852464..f985248b2c5b 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 Tue May 16 16:29:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Granados X-Patchwork-Id: 13243409 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 96E51C77B7F for ; Tue, 16 May 2023 16:30:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230385AbjEPQav (ORCPT ); Tue, 16 May 2023 12:30:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230492AbjEPQ3v (ORCPT ); Tue, 16 May 2023 12:29:51 -0400 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D95DE83D0 for ; Tue, 16 May 2023 09:29:38 -0700 (PDT) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20230516162926euoutp01257b1153a1d10acf34b2ae639d224885~frJrep_NS2686026860euoutp01h for ; Tue, 16 May 2023 16:29:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20230516162926euoutp01257b1153a1d10acf34b2ae639d224885~frJrep_NS2686026860euoutp01h DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1684254566; bh=+cvSrG9BF2Lh8leXK/b8umU3dWU2v/m9nMhuIbw7feg=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=XXd9PzLcwrhShGi9m5rO+q8JcMiGCAlxz8aJFQH16/9wnVyZaUc/T2UXiLcxLSuQg duSpYSUnXh6eNecoUT4tp1NzWyYXrv3z0yTyWats9eddtFrBqBWpfbhU7rvBWxXhr4 KZcUNPlTVdn8engGqmDMw4RxT+wEAEkS+73h7usE= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20230516162926eucas1p22bc2c754369a5817e3557e22647af663~frJrRxcWz2141021410eucas1p2n; Tue, 16 May 2023 16:29:26 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id BF.C3.42423.66FA3646; Tue, 16 May 2023 17:29:26 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20230516162926eucas1p27084bb4e8f7910f479133d1f88105aa8~frJq_EMY41612516125eucas1p2z; Tue, 16 May 2023 16:29:26 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20230516162926eusmtrp11d601a2a4bb1515b0f8779bf8015faf4~frJq9lxki2056220562eusmtrp1I; Tue, 16 May 2023 16:29:26 +0000 (GMT) X-AuditID: cbfec7f2-a3bff7000002a5b7-c2-6463af662a84 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 23.57.10549.66FA3646; Tue, 16 May 2023 17:29:26 +0100 (BST) Received: from CAMSVWEXC02.scsc.local (unknown [106.1.227.72]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20230516162926eusmtip1237878a60e3fff8168b3ec785c9ce841~frJq07vOU0643706437eusmtip1W; Tue, 16 May 2023 16:29:26 +0000 (GMT) Received: from localhost (106.210.248.56) by CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 16 May 2023 17:29:25 +0100 From: Joel Granados To: CC: Kees Cook , , Iurii Zaikin , , Sudip Mukherjee , Joel Granados Subject: [PATCH v3 6/6] sysctl: stop exporting register_sysctl_table Date: Tue, 16 May 2023 18:29:03 +0200 Message-ID: <20230516162903.3208880-7-j.granados@samsung.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230516162903.3208880-1-j.granados@samsung.com> MIME-Version: 1.0 X-Originating-IP: [106.210.248.56] X-ClientProxiedBy: CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) To CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplleLIzCtJLcpLzFFi42LZduznOd209ckpBjd2KFmc6c612LP3JIvF 5V1z2CxuTHjKaHHg9BRmi2U7/RzYPGY3XGTx2DnrLrvHgk2lHptWdbJ5fN4kF8AaxWWTkpqT WZZapG+XwJXxb4Z8wT/5igf/T7I0MG6W7GLk5JAQMJG4+aGNsYuRi0NIYAWjxOqnO9kgnC+M Evu/bGaBcD4zSly7sI8FpuVE/0FWiMRyRol7t08gVB08PA0qs4VRYtvZjcwgLWwCOhLn39wB s0UExCVOnN4MtpFZ4ClQ+97VbCAJYQEXic6O/UAJDg4WAVWJE1c5QMK8ArYS95++ZIdYLS/R dn06I4jNKWAn8X7NJiaIGkGJkzOfgJ3HDFTTvHU2M4QtIXHwxQtmiF4lifaJD1gh7FqJU1tu MYHcICFwh0Ni+/d5bBAJF4lP2+ZD2cISr45vgVosI3F6cg8LRMNkYMj8+8AO4axmlFjW+JUJ ospaouXKE6gOR4mle36DfSMhwCdx460gxEV8EpO2TWeGCPNKdLQJTWBUmYXkh1lIfpiF5IcF jMyrGMVTS4tz01OLDfNSy/WKE3OLS/PS9ZLzczcxAlPM6X/HP+1gnPvqo94hRiYOxkOMEhzM SiK8gX3JKUK8KYmVValF+fFFpTmpxYcYpTlYlMR5tW1PJgsJpCeWpGanphakFsFkmTg4pRqY uG+0PW+u+CI/0+HGtKd92mKlZeY9Wz1kGw7t/BBXwLxztdqK3cv5nprvUk+Pu/dWe+WWtjaD TIsdaxf8Fm1m+X/uytTdC5rPz7ixW1l0fnRW6TXr7wdS/VSEp/K/1pQM+PzoebtwYWIxW3Fy WlZT8rO3nq+y7+T3zpx5YH2eXtGmttxJr9i73044YPCq93pV2KX7ectN7juv0Txt/GvtBoEm zbN8C/0u3d/D5B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rBf2binuXnt7r3nWQ8dY8j82KzzVsnCRHx hzEHZnOdjAmYnqt6gYm5hpnH/9kydrNafuWP8UxiP9tfljY6Gj8+fHOF1AIp7psH16u5rIvW LxWSO99VkZ7+o0UyS4mlOCPRUIu5qDgRALb+MPlGAwAA X-CMS-MailID: 20230516162926eucas1p27084bb4e8f7910f479133d1f88105aa8 X-Msg-Generator: CA X-RootMTR: 20230516162926eucas1p27084bb4e8f7910f479133d1f88105aa8 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230516162926eucas1p27084bb4e8f7910f479133d1f88105aa8 References: <20230516162903.3208880-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". This plus the commits that remove register_sysctl_table from parport save 217 bytes: ./scripts/bloat-o-meter .bsysctl/vmlinux.old .bsysctl/vmlinux.new add/remove: 0/1 grow/shrink: 5/1 up/down: 458/-675 (-217) Function old new delta __register_sysctl_base 8 286 +278 parport_proc_register 268 379 +111 parport_device_proc_register 195 247 +52 kzalloc.constprop 598 608 +10 parport_default_proc_register 62 69 +7 register_sysctl_table 291 - -291 parport_sysctl_template 1288 904 -384 Total: Before=8603076, After=8602859, chg -0.00% Signed-off-by: Joel Granados Reviewed-by: Luis Chamberlain --- 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) { }