mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Eric W. Biederman" <ebiederm@xmission.com>
To: linux-kernel@vger.kernel.org
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
	David Howells <dhowells@redhat.com>
Subject: [PATCH 16/23] sysctl frv: Remove dead binary sysctl support
Date: Sun,  8 Nov 2009 04:22:03 -0800	[thread overview]
Message-ID: <1257682930-31401-16-git-send-email-ebiederm@xmission.com> (raw)
In-Reply-To: <m14op5jjo4.fsf@fess.ebiederm.org>

From: Eric W. Biederman <ebiederm@xmission.com>

Now that sys_sysctl is a generic wrapper around /proc/sys  .ctl_name
and .strategy members of sysctl tables are dead code.  Remove them.

Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
 arch/frv/kernel/pm.c     |  106 +---------------------------------------------
 arch/frv/kernel/sysctl.c |    3 -
 2 files changed, 2 insertions(+), 107 deletions(-)

diff --git a/arch/frv/kernel/pm.c b/arch/frv/kernel/pm.c
index 17e2e3f..940d8bb 100644
--- a/arch/frv/kernel/pm.c
+++ b/arch/frv/kernel/pm.c
@@ -211,37 +211,6 @@ static int cmode_procctl(ctl_table *ctl, int write,
 	return try_set_cmode(new_cmode)?:*lenp;
 }
 
-static int cmode_sysctl(ctl_table *table,
-			void __user *oldval, size_t __user *oldlenp,
-			void __user *newval, size_t newlen)
-{
-	if (oldval && oldlenp) {
-		size_t oldlen;
-
-		if (get_user(oldlen, oldlenp))
-			return -EFAULT;
-
-		if (oldlen != sizeof(int))
-			return -EINVAL;
-
-		if (put_user(clock_cmode_current, (unsigned __user *)oldval) ||
-		    put_user(sizeof(int), oldlenp))
-			return -EFAULT;
-	}
-	if (newval && newlen) {
-		int new_cmode;
-
-		if (newlen != sizeof(int))
-			return -EINVAL;
-
-		if (get_user(new_cmode, (int __user *)newval))
-			return -EFAULT;
-
-		return try_set_cmode(new_cmode)?:1;
-	}
-	return 1;
-}
-
 static int try_set_p0(int new_p0)
 {
 	unsigned long flags, clkc;
@@ -314,37 +283,6 @@ static int p0_procctl(ctl_table *ctl, int write,
 	return try_set_p0(new_p0)?:*lenp;
 }
 
-static int p0_sysctl(ctl_table *table,
-		     void __user *oldval, size_t __user *oldlenp,
-		     void __user *newval, size_t newlen)
-{
-	if (oldval && oldlenp) {
-		size_t oldlen;
-
-		if (get_user(oldlen, oldlenp))
-			return -EFAULT;
-
-		if (oldlen != sizeof(int))
-			return -EINVAL;
-
-		if (put_user(clock_p0_current, (unsigned __user *)oldval) ||
-		    put_user(sizeof(int), oldlenp))
-			return -EFAULT;
-	}
-	if (newval && newlen) {
-		int new_p0;
-
-		if (newlen != sizeof(int))
-			return -EINVAL;
-
-		if (get_user(new_p0, (int __user *)newval))
-			return -EFAULT;
-
-		return try_set_p0(new_p0)?:1;
-	}
-	return 1;
-}
-
 static int cm_procctl(ctl_table *ctl, int write,
 		      void __user *buffer, size_t *lenp, loff_t *fpos)
 {
@@ -358,42 +296,9 @@ static int cm_procctl(ctl_table *ctl, int write,
 	return try_set_cm(new_cm)?:*lenp;
 }
 
-static int cm_sysctl(ctl_table *table,
-		     void __user *oldval, size_t __user *oldlenp,
-		     void __user *newval, size_t newlen)
-{
-	if (oldval && oldlenp) {
-		size_t oldlen;
-
-		if (get_user(oldlen, oldlenp))
-			return -EFAULT;
-
-		if (oldlen != sizeof(int))
-			return -EINVAL;
-
-		if (put_user(clock_cm_current, (unsigned __user *)oldval) ||
-		    put_user(sizeof(int), oldlenp))
-			return -EFAULT;
-	}
-	if (newval && newlen) {
-		int new_cm;
-
-		if (newlen != sizeof(int))
-			return -EINVAL;
-
-		if (get_user(new_cm, (int __user *)newval))
-			return -EFAULT;
-
-		return try_set_cm(new_cm)?:1;
-	}
-	return 1;
-}
-
-
 static struct ctl_table pm_table[] =
 {
 	{
-		.ctl_name	= CTL_UNNUMBERED,
 		.procname	= "suspend",
 		.data		= NULL,
 		.maxlen		= 0,
@@ -401,44 +306,37 @@ static struct ctl_table pm_table[] =
 		.proc_handler	= &sysctl_pm_do_suspend,
 	},
 	{
-		.ctl_name	= CTL_PM_CMODE,
 		.procname	= "cmode",
 		.data		= &clock_cmode_current,
 		.maxlen		= sizeof(int),
 		.mode		= 0644,
 		.proc_handler	= &cmode_procctl,
-		.strategy	= &cmode_sysctl,
 	},
 	{
-		.ctl_name	= CTL_PM_P0,
 		.procname	= "p0",
 		.data		= &clock_p0_current,
 		.maxlen		= sizeof(int),
 		.mode		= 0644,
 		.proc_handler	= &p0_procctl,
-		.strategy	= &p0_sysctl,
 	},
 	{
-		.ctl_name	= CTL_PM_CM,
 		.procname	= "cm",
 		.data		= &clock_cm_current,
 		.maxlen		= sizeof(int),
 		.mode		= 0644,
 		.proc_handler	= &cm_procctl,
-		.strategy	= &cm_sysctl,
 	},
-	{ .ctl_name = 0}
+	{ }
 };
 
 static struct ctl_table pm_dir_table[] =
 {
 	{
-		.ctl_name	= CTL_PM,
 		.procname	= "pm",
 		.mode		= 0555,
 		.child		= pm_table,
 	},
-	{ .ctl_name = 0}
+	{ }
 };
 
 /*
diff --git a/arch/frv/kernel/sysctl.c b/arch/frv/kernel/sysctl.c
index 139628a..b30a4f2 100644
--- a/arch/frv/kernel/sysctl.c
+++ b/arch/frv/kernel/sysctl.c
@@ -176,7 +176,6 @@ static int procctl_frv_pin_cxnr(ctl_table *table, int write, struct file *filp,
 static struct ctl_table frv_table[] =
 {
 	{
-		.ctl_name 	= CTL_UNNUMBERD,
 		.procname 	= "cache-mode",
 		.data		= NULL,
 		.maxlen		= 0,
@@ -185,7 +184,6 @@ static struct ctl_table frv_table[] =
 	},
 #ifdef CONFIG_MMU
 	{
-		.ctl_name	= CTL_UNNUMBERD,
 		.procname	= "pin-cxnr",
 		.data		= NULL,
 		.maxlen		= 0,
@@ -203,7 +201,6 @@ static struct ctl_table frv_table[] =
 static struct ctl_table frv_dir_table[] =
 {
 	{
-		.ctl_name	= CTL_UNNUMBERED,
 		.procname	= "frv",
 		.mode 		= 0555,
 		.child		= frv_table
-- 
1.6.5.2.143.g8cc62


  parent reply	other threads:[~2009-11-08 12:24 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-08 12:16 [PATCH 00/23] Removal of " Eric W. Biederman
2009-11-08 12:21 ` [PATCH 01/23] sysctl: Remove the unused frv sysctl unumbers Eric W. Biederman
2009-11-08 12:21 ` [PATCH 02/23] sysctl: Stop using binary sysctl numbers in arlan Eric W. Biederman
2009-11-11 21:07   ` John W. Linville
2009-11-08 12:21 ` [PATCH 03/23] sysctl: Reduce sys_sysctl to a compatibility wrapper around /proc/sys Eric W. Biederman
2009-11-08 12:21 ` [PATCH 04/23] sysctl: Neuter the generic sysctl strategy routines Eric W. Biederman
2009-11-08 12:21 ` [PATCH 05/23] sysctl: Remove dead code from sysctl_check Eric W. Biederman
2009-11-08 12:21 ` [PATCH 06/23] sysctl: Remove references to ctl_name and strategy from the generic sysctl table Eric W. Biederman
2009-11-08 12:21 ` [PATCH 07/23] sysctl: Don't look at ctl_name and strategy in the generic code Eric W. Biederman
2009-11-08 12:21 ` [PATCH 08/23] sysctl ipc: Remove dead binary sysctl support code Eric W. Biederman
2009-11-08 12:21 ` [PATCH 09/23] sysctl net: Remove unused binary sysctl code Eric W. Biederman
2009-11-08 12:21 ` [PATCH 10/23] sysctl fs: Remove dead binary sysctl support Eric W. Biederman
2009-11-08 12:21 ` [PATCH 11/23] sysctl kernel: Remove binary sysctl logic Eric W. Biederman
2009-11-08 12:21 ` [PATCH 12/23] sysctl security/keys: Remove dead binary sysctl support Eric W. Biederman
2009-11-08 12:22 ` [PATCH 13/23] sysctl crypto: " Eric W. Biederman
2009-11-08 15:44   ` Herbert Xu
2009-11-08 12:22 ` [PATCH 14/23] sysctl drivers: " Eric W. Biederman
2009-11-09  8:17   ` Clemens Ladisch
2009-11-08 12:22 ` [PATCH 15/23] sysctl mips/lasat: " Eric W. Biederman
2009-11-09 14:10   ` Ralf Baechle
2009-11-08 12:22 ` Eric W. Biederman [this message]
2009-11-08 12:22 ` [PATCH 17/23] sysctl s390: Remove dead sysctl binary support Eric W. Biederman
2009-11-08 12:22 ` [PATCH 18/23] sysctl ia64: Remove dead binary sysctl support Eric W. Biederman
2009-11-08 12:22 ` [PATCH 19/23] sysctl powerpc: " Eric W. Biederman
2009-11-08 20:44   ` Benjamin Herrenschmidt
2009-11-08 12:22 ` [PATCH 20/23] sysctl sh: " Eric W. Biederman
2009-11-08 12:22 ` [PATCH 21/23] sysctl x86: " Eric W. Biederman
2009-11-08 12:22 ` [PATCH 22/23] sysctl arm: Remove " Eric W. Biederman
2009-11-08 12:34   ` Russell King
2009-11-08 22:45     ` Eric W. Biederman
2009-11-08 22:56       ` Russell King
2009-11-08 23:31         ` Eric W. Biederman
2009-11-08 23:34           ` Russell King
2009-11-08 23:05       ` Eric W. Biederman
2009-11-09  0:48         ` Arjan van de Ven
2009-11-09  3:27           ` Eric W. Biederman
2009-11-09  4:57             ` Arjan van de Ven
2009-11-09  5:37               ` Eric W. Biederman
2009-11-09  9:38                 ` Andi Kleen
2009-11-09 11:45                   ` Eric W. Biederman
2009-11-09 12:04                     ` Andi Kleen
2009-11-09 12:41                       ` Eric W. Biederman
2009-11-09 13:28                         ` Andi Kleen
2009-11-09 15:28                           ` Arnd Bergmann
2009-11-09 15:46                             ` Andi Kleen
2009-11-09 16:23                               ` Arnd Bergmann
2009-11-10  4:42                                 ` Eric W. Biederman
2009-11-10  8:01                               ` Eric W. Biederman
2009-11-11  2:31                               ` Eric W. Biederman
2009-11-09 12:42                       ` Eric W. Biederman
2009-11-08 12:22 ` [PATCH 23/23] sysctl: Remove the last of the generic " Eric W. Biederman
2009-11-08 13:06 ` [PATCH 00/23] Removal of " Arnd Bergmann
2009-11-09  3:44   ` Eric W. Biederman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1257682930-31401-16-git-send-email-ebiederm@xmission.com \
    --to=ebiederm@xmission.com \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®