From nobody Wed Feb 11 18:50:05 2026 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 96250C74A5B for ; Fri, 10 Mar 2023 23:45:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231635AbjCJXpt (ORCPT ); Fri, 10 Mar 2023 18:45:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231277AbjCJXpo (ORCPT ); Fri, 10 Mar 2023 18:45:44 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1480712B007; Fri, 10 Mar 2023 15:45:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=BdtDngCz11vLEZXj7V3uC9J00TCr9KSXBOiIikCKO7U=; b=Tmh2ag0sjCovH4EJWWQwXdUxX+ tenwk94A3/aExZGoKIycS4E/qwjvw6GBoYfMCn+Ts3UWB9Q8IxsFLVsKIEwRsQCRy1HU5h3V4Z2zz m6HJNegAhauwIIB4ZysU9UXzB0vIIFo8xoHYNHWY3rTbktsNh6Qr2xDGTUm3R7SFdhWczzwQX5pY6 CyimNzOoggaPYT46Z0oKm+CeOxCyVPQoniSfJes2rWunXJYH4vwzDGa1nFKSDTPJrdC2vHFw1AHDJ 4e7fnVs6H7XBkt3r5su+QCXMkzc1rIdlikYOzfLgGyR/qXn/dg+OnpFliqe0hMsZ0lQfyhZns9S1N P7aN9aeQ==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pamQS-00Gj2r-0b; Fri, 10 Mar 2023 23:45:28 +0000 From: Luis Chamberlain To: hca@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org, sudipm.mukherjee@gmail.com Cc: ebiederm@xmission.com, keescook@chromium.org, yzaikin@google.com, j.granados@samsung.com, patches@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Luis Chamberlain Subject: [PATCH 1/6] s390: simplify one-level sysctl registration for topology_ctl_table Date: Fri, 10 Mar 2023 15:45:20 -0800 Message-Id: <20230310234525.3986352-2-mcgrof@kernel.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230310234525.3986352-1-mcgrof@kernel.org> References: <20230310234525.3986352-1-mcgrof@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" There is no need to declare an extra tables to just create directory, this can be easily be done with a prefix path with register_sysctl(). Simplify this registration. Signed-off-by: Luis Chamberlain Reviewed-by: Vasily Gorbik --- arch/s390/kernel/topology.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c index c6eecd4a5302..e5d6a1c25d13 100644 --- a/arch/s390/kernel/topology.c +++ b/arch/s390/kernel/topology.c @@ -637,16 +637,6 @@ static struct ctl_table topology_ctl_table[] =3D { { }, }; =20 -static struct ctl_table topology_dir_table[] =3D { - { - .procname =3D "s390", - .maxlen =3D 0, - .mode =3D 0555, - .child =3D topology_ctl_table, - }, - { }, -}; - static int __init topology_init(void) { timer_setup(&topology_timer, topology_timer_fn, TIMER_DEFERRABLE); @@ -654,7 +644,7 @@ static int __init topology_init(void) set_topology_timer(); else topology_update_polarization_simple(); - register_sysctl_table(topology_dir_table); + register_sysctl("s390", topology_ctl_table); return device_create_file(cpu_subsys.dev_root, &dev_attr_dispatching); } device_initcall(topology_init); --=20 2.39.1 From nobody Wed Feb 11 18:50:05 2026 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 664BBC6FA99 for ; Fri, 10 Mar 2023 23:46:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232095AbjCJXqJ (ORCPT ); Fri, 10 Mar 2023 18:46:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231654AbjCJXpq (ORCPT ); Fri, 10 Mar 2023 18:45:46 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 149A012B03A; Fri, 10 Mar 2023 15:45:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=LMz951lH+GTlXBdT5Z97YwiBE8EmQ72In88ZwOJtlek=; b=OflQ0N4/CEo1p1GvnhPn14bpjg vmz+hv+Jy3oouD/nIf1Vs6OZVTZLHssU2qrv5wXv26MXvSDxbzSf/ixlaGq9di1FLc3Tt+NaldRzl gVkepqTIr+4FuiUK0XdHT/UeYiYo8Xp7YYrDphAe04rmoUut+n/Iv0DkWyLbvTbzbM7EwE2raaTmg 3dD+DLd3lGYlD8qCF+wZi0zvK7gWAapuOSVbXih5eWvfZ/3xzZwVEzDLXlMO7Z2JZaY6eGW15pOaR CN27Hg3mEWxeTKsLrPi17eAX6fCPSZuiDaBT18bXXVPZtUwwUtLkxbZeNKuOONRADTL4BZLYiluq3 ag/IEb0Q==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pamQS-00Gj2v-1v; Fri, 10 Mar 2023 23:45:28 +0000 From: Luis Chamberlain To: hca@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org, sudipm.mukherjee@gmail.com Cc: ebiederm@xmission.com, keescook@chromium.org, yzaikin@google.com, j.granados@samsung.com, patches@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Luis Chamberlain Subject: [PATCH 2/6] s390: simplify one-level syctl registration for s390dbf_table Date: Fri, 10 Mar 2023 15:45:21 -0800 Message-Id: <20230310234525.3986352-3-mcgrof@kernel.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230310234525.3986352-1-mcgrof@kernel.org> References: <20230310234525.3986352-1-mcgrof@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" There is no need to declare an extra tables to just create directory, this can be easily be done with a prefix path with register_sysctl(). Simplify this registration. Signed-off-by: Luis Chamberlain Reviewed-by: Vasily Gorbik --- arch/s390/kernel/debug.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c index b376f0377a2c..221c865785c2 100644 --- a/arch/s390/kernel/debug.c +++ b/arch/s390/kernel/debug.c @@ -981,16 +981,6 @@ static struct ctl_table s390dbf_table[] =3D { { } }; =20 -static struct ctl_table s390dbf_dir_table[] =3D { - { - .procname =3D "s390dbf", - .maxlen =3D 0, - .mode =3D S_IRUGO | S_IXUGO, - .child =3D s390dbf_table, - }, - { } -}; - static struct ctl_table_header *s390dbf_sysctl_header; =20 /** @@ -1574,7 +1564,7 @@ static int debug_sprintf_format_fn(debug_info_t *id, = struct debug_view *view, */ static int __init debug_init(void) { - s390dbf_sysctl_header =3D register_sysctl_table(s390dbf_dir_table); + s390dbf_sysctl_header =3D register_sysctl("s390dbf", s390dbf_table); mutex_lock(&debug_mutex); debug_debugfs_root_entry =3D debugfs_create_dir(DEBUG_DIR_ROOT, NULL); initialized =3D 1; --=20 2.39.1 From nobody Wed Feb 11 18:50:05 2026 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 9DFE2C76186 for ; Fri, 10 Mar 2023 23:46:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231559AbjCJXqB (ORCPT ); Fri, 10 Mar 2023 18:46:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230203AbjCJXpp (ORCPT ); Fri, 10 Mar 2023 18:45:45 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14C2912B3D7; Fri, 10 Mar 2023 15:45:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=H5HqYRjESHY8xUnMrM+cMVopzwc1JUtrK5M1N6TB7H4=; b=Rb2ENORkOAXfh2XoBReOuS75Tk QqougMDviCgYgMy+K8gXsHJzMfAjPBP7p9aqASPSUV7bZqiRvrmjXrA3FnPk+e+c/xr4wFRIsB/bA j8j7O3tzwutLtXlFCED7jR5LAMiWEo8vD7BzCH7CYvQPjMZVWEynP7TtwIcvWh7IJZTAXigSDdTeJ FvX6Xca2XQ/MZEOdQ2HIofICvCWJrvY5GC8ECdH52BnqXyBtjnb3Or+a5MacnTO0NUwHoXKgq2Zaq SzHxI9n1Rt3jYzr+Gw6pebhK9sTPr/hf15Xhl3Dw/YbihBpStQ9m29aDqpAc1mu2MeU8jE+qzB8vR 5scFTiOg==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pamQS-00Gj2z-3K; Fri, 10 Mar 2023 23:45:28 +0000 From: Luis Chamberlain To: hca@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org, sudipm.mukherjee@gmail.com Cc: ebiederm@xmission.com, keescook@chromium.org, yzaikin@google.com, j.granados@samsung.com, patches@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Luis Chamberlain Subject: [PATCH 3/6] s390: simplify one-level sysctl registration for appldata_table Date: Fri, 10 Mar 2023 15:45:22 -0800 Message-Id: <20230310234525.3986352-4-mcgrof@kernel.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230310234525.3986352-1-mcgrof@kernel.org> References: <20230310234525.3986352-1-mcgrof@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" There is no need to declare an extra tables to just create directory, this can be easily be done with a prefix path with register_sysctl(). Simplify this registration. Signed-off-by: Luis Chamberlain Reviewed-by: Vasily Gorbik --- arch/s390/appldata/appldata_base.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/applda= ta_base.c index c0fd29133f27..c593f2228083 100644 --- a/arch/s390/appldata/appldata_base.c +++ b/arch/s390/appldata/appldata_base.c @@ -66,16 +66,6 @@ static struct ctl_table appldata_table[] =3D { { }, }; =20 -static struct ctl_table appldata_dir_table[] =3D { - { - .procname =3D appldata_proc_name, - .maxlen =3D 0, - .mode =3D S_IRUGO | S_IXUGO, - .child =3D appldata_table, - }, - { }, -}; - /* * Timer */ @@ -422,7 +412,7 @@ static int __init appldata_init(void) appldata_wq =3D alloc_ordered_workqueue("appldata", 0); if (!appldata_wq) return -ENOMEM; - appldata_sysctl_header =3D register_sysctl_table(appldata_dir_table); + appldata_sysctl_header =3D register_sysctl(appldata_proc_name, appldata_t= able); return 0; } =20 --=20 2.39.1 From nobody Wed Feb 11 18:50:05 2026 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 1E9CDC6FA99 for ; Fri, 10 Mar 2023 23:46:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232029AbjCJXqR (ORCPT ); Fri, 10 Mar 2023 18:46:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231449AbjCJXpp (ORCPT ); Fri, 10 Mar 2023 18:45:45 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14CFD12B7D3; Fri, 10 Mar 2023 15:45:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=N5vx1FBpbc8LlYLlnu7qtqpLSHJPRrla5oNVHVuiKnI=; b=IK/npqdfvhyNAJvSI8r427YlNX RSVirLCMWv4Rr8iJyWSYktDBdNXsX1ZR+c6rhA0TmzDEkh3Vcrp/uF0UQJ+utUs5tPGi+F4VP4/rU tSdo7bRWz1clO+u+ufJTqZ2YzDinsFuuvFpcigeJ/rU6oLLooGaUqIWgOrdA9XPMxcLBFzUL273aU iyqelPcFo9CDdxyxD/7ANzhY92cyIPXjB9mTxx4+ZDErTgZq8xgYjWNpZaI12xLAImgh9S3imGmzk 0mHwKUcM2B/suuA5MX+v2xKZ6AsD0nHJx/RB10Ka3C+9yGPPsrFJDtJWv7ZI12vaqmPNlCLlUgMzm 12IlGySA==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pamQS-00Gj31-5G; Fri, 10 Mar 2023 23:45:28 +0000 From: Luis Chamberlain To: hca@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org, sudipm.mukherjee@gmail.com Cc: ebiederm@xmission.com, keescook@chromium.org, yzaikin@google.com, j.granados@samsung.com, patches@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Luis Chamberlain Subject: [PATCH 4/6] s390: simplify one level sysctl registration for cmm_table Date: Fri, 10 Mar 2023 15:45:23 -0800 Message-Id: <20230310234525.3986352-5-mcgrof@kernel.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230310234525.3986352-1-mcgrof@kernel.org> References: <20230310234525.3986352-1-mcgrof@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" There is no need to declare an extra tables to just create directory, this can be easily be done with a prefix path with register_sysctl(). Simplify this registration. Signed-off-by: Luis Chamberlain Reviewed-by: Vasily Gorbik --- arch/s390/mm/cmm.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c index 9141ed4c52e9..5300c6867d5e 100644 --- a/arch/s390/mm/cmm.c +++ b/arch/s390/mm/cmm.c @@ -335,16 +335,6 @@ static struct ctl_table cmm_table[] =3D { { } }; =20 -static struct ctl_table cmm_dir_table[] =3D { - { - .procname =3D "vm", - .maxlen =3D 0, - .mode =3D 0555, - .child =3D cmm_table, - }, - { } -}; - #ifdef CONFIG_CMM_IUCV #define SMSG_PREFIX "CMM" static void cmm_smsg_target(const char *from, char *msg) @@ -389,7 +379,7 @@ static int __init cmm_init(void) { int rc =3D -ENOMEM; =20 - cmm_sysctl_header =3D register_sysctl_table(cmm_dir_table); + cmm_sysctl_header =3D register_sysctl("vm", cmm_table); if (!cmm_sysctl_header) goto out_sysctl; #ifdef CONFIG_CMM_IUCV --=20 2.39.1 From nobody Wed Feb 11 18:50:05 2026 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 8945CC6FA99 for ; Fri, 10 Mar 2023 23:46:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232105AbjCJXqM (ORCPT ); Fri, 10 Mar 2023 18:46:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231657AbjCJXpq (ORCPT ); Fri, 10 Mar 2023 18:45:46 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 159DB12B942; Fri, 10 Mar 2023 15:45:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=nHMN7uwZ1jz4t3b3KbBdxN2XO9S9Ia12wFzWNFd3opY=; b=3GDvwXXQTMtsfQLNqy0vJ3E8tc 6n7irTuEwDXgM6CQLVv8I1yk6aK+TDHsXV86/H2xr6+YRZTiP0ByLSm8F7t8FVREr2m4jd5VaVRLa Rq63/fdFYH5SdwcxIz+v2kxZC7QiYkwwbQ8/BlfNQxBOncdyV5fuBBUsPxkWc7+xlY7t9OAy/aBGs +vpbqjiAfwhDgDAxTemRveRQB+7DdGJCae8xMhSFN1OAYe0bsNxr0zQW94wypu6N3TY3zyKGSdFFS vbDpisKqOX1y+h6VL7kC1FIRNbL4ZUHRIcIdZ1Y+AIi/5E1eM5nmaM/J5JAsEeniE9bUanhpP4xCZ ddqDO9xw==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pamQS-00Gj33-7A; Fri, 10 Mar 2023 23:45:28 +0000 From: Luis Chamberlain To: hca@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org, sudipm.mukherjee@gmail.com Cc: ebiederm@xmission.com, keescook@chromium.org, yzaikin@google.com, j.granados@samsung.com, patches@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Luis Chamberlain Subject: [PATCH 5/6] s390: simplify one-level sysctl registration for page_table_sysctl Date: Fri, 10 Mar 2023 15:45:24 -0800 Message-Id: <20230310234525.3986352-6-mcgrof@kernel.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230310234525.3986352-1-mcgrof@kernel.org> References: <20230310234525.3986352-1-mcgrof@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" There is no need to declare an extra tables to just create directory, this can be easily be done with a prefix path with register_sysctl(). Simplify this registration. Signed-off-by: Luis Chamberlain Reviewed-by: Vasily Gorbik --- arch/s390/mm/pgalloc.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/arch/s390/mm/pgalloc.c b/arch/s390/mm/pgalloc.c index 2de48b2c1b04..0f68b7257e08 100644 --- a/arch/s390/mm/pgalloc.c +++ b/arch/s390/mm/pgalloc.c @@ -33,19 +33,9 @@ static struct ctl_table page_table_sysctl[] =3D { { } }; =20 -static struct ctl_table page_table_sysctl_dir[] =3D { - { - .procname =3D "vm", - .maxlen =3D 0, - .mode =3D 0555, - .child =3D page_table_sysctl, - }, - { } -}; - static int __init page_table_register_sysctl(void) { - return register_sysctl_table(page_table_sysctl_dir) ? 0 : -ENOMEM; + return register_sysctl("vm", page_table_sysctl) ? 0 : -ENOMEM; } __initcall(page_table_register_sysctl); =20 --=20 2.39.1 From nobody Wed Feb 11 18:50:05 2026 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 407DDC6FD19 for ; Fri, 10 Mar 2023 23:46:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232091AbjCJXqG (ORCPT ); Fri, 10 Mar 2023 18:46:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231326AbjCJXpp (ORCPT ); Fri, 10 Mar 2023 18:45:45 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13FB4126991; Fri, 10 Mar 2023 15:45:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=6RSbXeOyJXMcC096K906LGWK1pufxQXw88aIMgb//hY=; b=oPkUxijQji7nsAPM9NoPoMym+I AR65R3ylE5x03QCPirCr2PlHYS0RXVk6IA586IZCoN+CVwZyxHSPlfGIRAOj/TNyFpl67NiQB0txS dNinDi5REGeIrrg5VGBGMjJzr6z9eF1AmBa7IFYBe5tcWeTT1u2eu7mHZsx9QBht1S6dYvGp60Lij y5NMIxZAhBUSZlsUAT58b4NtLvGew+LNFw6z8eEPaI+yo1xxDFjfA08xuqBhHueLjj9y4A1VV/AqF RktygUAbAEOmsDduIfaJl+JYHG2UDxfI25po7gm08BHdl3sZJ03wZ0inOuzaNEmxwVhVv0zZ8FAix EUc9SXIA==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pamQS-00Gj35-95; Fri, 10 Mar 2023 23:45:28 +0000 From: Luis Chamberlain To: hca@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org, sudipm.mukherjee@gmail.com Cc: ebiederm@xmission.com, keescook@chromium.org, yzaikin@google.com, j.granados@samsung.com, patches@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Luis Chamberlain Subject: [PATCH 6/6] s390: simplify dynamic sysctl registration for appldata_register_ops Date: Fri, 10 Mar 2023 15:45:25 -0800 Message-Id: <20230310234525.3986352-7-mcgrof@kernel.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230310234525.3986352-1-mcgrof@kernel.org> References: <20230310234525.3986352-1-mcgrof@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The routine appldata_register_ops() allocates a sysctl table with 4 entries. The firsts one, ops->ctl_table[0] is the parent directory with an empty entry following it, ops->ctl_table[1]. The next entry is for the the ops->name and that is ops->ctl_table[2]. It needs an empty entry following that, and that is ops->ctl_table[3]. And so hence the kcalloc(4, sizeof(struct ctl_table), GFP_KERNEL). We can simplify this considerably since sysctl_register("foo", table) can create the parent directory for us if it does not exist. So we can just remove the first two entries and move back the ops->name to the first entry, and just use kcalloc(2, ...). Signed-off-by: Luis Chamberlain Reviewed-by: Vasily Gorbik --- arch/s390/appldata/appldata_base.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/applda= ta_base.c index c593f2228083..a60c1e093039 100644 --- a/arch/s390/appldata/appldata_base.c +++ b/arch/s390/appldata/appldata_base.c @@ -351,7 +351,8 @@ int appldata_register_ops(struct appldata_ops *ops) if (ops->size > APPLDATA_MAX_REC_SIZE) return -EINVAL; =20 - ops->ctl_table =3D kcalloc(4, sizeof(struct ctl_table), GFP_KERNEL); + /* The last entry must be an empty one */ + ops->ctl_table =3D kcalloc(2, sizeof(struct ctl_table), GFP_KERNEL); if (!ops->ctl_table) return -ENOMEM; =20 @@ -359,17 +360,12 @@ int appldata_register_ops(struct appldata_ops *ops) list_add(&ops->list, &appldata_ops_list); mutex_unlock(&appldata_ops_mutex); =20 - ops->ctl_table[0].procname =3D appldata_proc_name; - ops->ctl_table[0].maxlen =3D 0; - ops->ctl_table[0].mode =3D S_IRUGO | S_IXUGO; - ops->ctl_table[0].child =3D &ops->ctl_table[2]; + ops->ctl_table[0].procname =3D ops->name; + ops->ctl_table[0].mode =3D S_IRUGO | S_IWUSR; + ops->ctl_table[0].proc_handler =3D appldata_generic_handler; + ops->ctl_table[0].data =3D ops; =20 - ops->ctl_table[2].procname =3D ops->name; - ops->ctl_table[2].mode =3D S_IRUGO | S_IWUSR; - ops->ctl_table[2].proc_handler =3D appldata_generic_handler; - ops->ctl_table[2].data =3D ops; - - ops->sysctl_header =3D register_sysctl_table(ops->ctl_table); + ops->sysctl_header =3D register_sysctl(appldata_proc_name, ops->ctl_table= ); if (!ops->sysctl_header) goto out; return 0; --=20 2.39.1