mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Gabriel C <nix.or.die@googlemail.com>,
	Michal Piotrowski <michal.k.k.piotrowski@gmail.com>,
	linux-kernel@vger.kernel.org, Netdev <netdev@vger.kernel.org>,
	coreteam@netfilter.org, Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: [PATCH 2/7] sysctl: parport remove binary paths.
Date: Fri, 10 Aug 2007 15:01:39 -0600	[thread overview]
Message-ID: <m1lkcjw1cc.fsf_-_@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <m1ps1vw1ey.fsf_-_@ebiederm.dsl.xmission.com> (Eric W. Biederman's message of "Fri, 10 Aug 2007 15:00:05 -0600")


The sysctl binary paths don't look as if they even code work,
.data is not filled in, and all of the proc_handlers look at
extra1 and there is not strategy routine.

So just kill the binary paths.

In addition this patch removes the setting of extra1
on directories.  It doesn't look like the parport code
ever examines it, and it's bad sysctl form.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
 drivers/parport/procfs.c |   38 +++++---------------------------------
 1 files changed, 5 insertions(+), 33 deletions(-)

diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c
index bdbdab9..ed82e41 100644
--- a/drivers/parport/procfs.c
+++ b/drivers/parport/procfs.c
@@ -237,7 +237,7 @@ static int do_hardware_modes (ctl_table *table, int write,
 #define PARPORT_PARPORT_DIR(CHILD) { .ctl_name = DEV_PARPORT, .procname = "parport", \
                                      .mode = 0555, .child = CHILD }
 #define PARPORT_DEV_DIR(CHILD) { .ctl_name = CTL_DEV, .procname = "dev", .mode = 0555, .child = CHILD }
-#define PARPORT_DEVICES_ROOT_DIR  { .ctl_name = DEV_PARPORT_DEVICES, .procname = "devices", \
+#define PARPORT_DEVICES_ROOT_DIR  {  .procname = "devices", \
                                     .mode = 0555, .child = NULL }
 
 static const unsigned long parport_min_timeslice_value =
@@ -266,7 +266,6 @@ static const struct parport_sysctl_table parport_sysctl_template = {
 	.sysctl_header = NULL,
         {
 		{
-			.ctl_name	= DEV_PARPORT_SPINTIME,
 			.procname	= "spintime",
 			.data		= NULL,
 			.maxlen		= sizeof(int),
@@ -276,7 +275,6 @@ static const struct parport_sysctl_table parport_sysctl_template = {
 			.extra2		= (void*) &parport_max_spintime_value
 		},
 		{
-			.ctl_name	= DEV_PARPORT_BASE_ADDR,
 			.procname	= "base-addr",
 			.data		= NULL,
 			.maxlen		= 0,
@@ -284,7 +282,6 @@ static const struct parport_sysctl_table parport_sysctl_template = {
 			.proc_handler	= &do_hardware_base_addr
 		},
 		{
-			.ctl_name	= DEV_PARPORT_IRQ,
 			.procname	= "irq",
 			.data		= NULL,
 			.maxlen		= 0,
@@ -292,7 +289,6 @@ static const struct parport_sysctl_table parport_sysctl_template = {
 			.proc_handler	= &do_hardware_irq
 		},
 		{
-			.ctl_name	= DEV_PARPORT_DMA,
 			.procname	= "dma",
 			.data		= NULL,
 			.maxlen		= 0,
@@ -300,7 +296,6 @@ static const struct parport_sysctl_table parport_sysctl_template = {
 			.proc_handler	= &do_hardware_dma
 		},
 		{
-			.ctl_name	= DEV_PARPORT_MODES,
 			.procname	= "modes",
 			.data		= NULL,
 			.maxlen		= 0,
@@ -310,7 +305,6 @@ static const struct parport_sysctl_table parport_sysctl_template = {
 		PARPORT_DEVICES_ROOT_DIR,
 #ifdef CONFIG_PARPORT_1284
 		{
-			.ctl_name	= DEV_PARPORT_AUTOPROBE,
 			.procname	= "autoprobe",
 			.data		= NULL,
 			.maxlen		= 0,
@@ -318,7 +312,6 @@ static const struct parport_sysctl_table parport_sysctl_template = {
 			.proc_handler	= &do_autoprobe
 		},
 		{
-			.ctl_name	= DEV_PARPORT_AUTOPROBE + 1,
 			.procname	= "autoprobe0",
 			.data		= NULL,
 			.maxlen		= 0,
@@ -326,7 +319,6 @@ static const struct parport_sysctl_table parport_sysctl_template = {
 			.proc_handler	=  &do_autoprobe
 		},
 		{
-			.ctl_name	= DEV_PARPORT_AUTOPROBE + 2,
 			.procname	= "autoprobe1",
 			.data		= NULL,
 			.maxlen		= 0,
@@ -334,7 +326,6 @@ static const struct parport_sysctl_table parport_sysctl_template = {
 			.proc_handler	= &do_autoprobe
 		},
 		{
-			.ctl_name	= DEV_PARPORT_AUTOPROBE + 3,
 			.procname	= "autoprobe2",
 			.data		= NULL,
 			.maxlen		= 0,
@@ -342,7 +333,6 @@ static const struct parport_sysctl_table parport_sysctl_template = {
 			.proc_handler	= &do_autoprobe
 		},
 		{
-			.ctl_name	= DEV_PARPORT_AUTOPROBE + 4,
 			.procname	= "autoprobe3",
 			.data		= NULL,
 			.maxlen		= 0,
@@ -354,7 +344,6 @@ static const struct parport_sysctl_table parport_sysctl_template = {
 	},
 	{
 		{
-			.ctl_name	= DEV_PARPORT_DEVICES_ACTIVE,
 			.procname	= "active",
 			.data		= NULL,
 			.maxlen		= 0,
@@ -393,7 +382,6 @@ parport_device_sysctl_template = {
 	.sysctl_header = NULL,
 	{
 		{
-			.ctl_name 	= DEV_PARPORT_DEVICE_TIMESLICE,
 			.procname 	= "timeslice",
 			.data		= NULL,
 			.maxlen		= sizeof(int),
@@ -449,7 +437,6 @@ parport_default_sysctl_table = {
 	.sysctl_header	= NULL,
 	{
 		{
-			.ctl_name	= DEV_PARPORT_DEFAULT_TIMESLICE,
 			.procname	= "timeslice",
 			.data		= &parport_default_timeslice,
 			.maxlen		= sizeof(parport_default_timeslice),
@@ -459,7 +446,6 @@ parport_default_sysctl_table = {
 			.extra2		= (void*) &parport_max_timeslice_value
 		},
 		{
-			.ctl_name	= DEV_PARPORT_DEFAULT_SPINTIME,
 			.procname	= "spintime",
 			.data		= &parport_default_spintime,
 			.maxlen		= sizeof(parport_default_spintime),
@@ -502,7 +488,7 @@ int parport_proc_register(struct parport *port)
 
 	t->device_dir[0].extra1 = port;
 
-	for (i = 0; i < 8; i++)
+	for (i = 0; i < 5; i++)
 		t->vars[i].extra1 = port;
 
 	t->vars[0].data = &port->spintime;
@@ -512,7 +498,7 @@ int parport_proc_register(struct parport *port)
 		t->vars[6 + i].extra2 = &port->probe_info[i];
 
 	t->port_dir[0].procname = port->name;
-	t->port_dir[0].ctl_name = port->number + 1; /* nb 0 isn't legal here */
+	t->port_dir[0].ctl_name = 0;
 
 	t->port_dir[0].child = t->vars;
 	t->parport_dir[0].child = t->port_dir;
@@ -551,26 +537,12 @@ int parport_device_proc_register(struct pardevice *device)
 	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].ctl_name = port->number + 1; /* nb 0 isn't legal here */
+	t->port_dir[0].ctl_name = 0;
 	t->port_dir[0].child = t->devices_root_dir;
 	t->devices_root_dir[0].child = t->device_dir;
 
-#ifdef CONFIG_PARPORT_1284
-
-	t->device_dir[0].ctl_name =
-		parport_device_num(port->number, port->muxport,
-				   device->daisy)
-		+ 1;  /* nb 0 isn't legal here */ 
-
-#else /* No IEEE 1284 support */
-
-	/* parport_device_num isn't available. */
-	t->device_dir[0].ctl_name = 1;
-	
-#endif /* IEEE 1284 support or not */
-
+	t->device_dir[0].ctl_name = 0;
 	t->device_dir[0].procname = device->name;
-	t->device_dir[0].extra1 = device;
 	t->device_dir[0].child = t->vars;
 	t->vars[0].data = &device->timeslice;
 
-- 
1.5.1.1.181.g2de0


  reply	other threads:[~2007-08-10 21:02 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-10  5:42 2.6.23-rc2-mm2 Andrew Morton
2007-08-10  7:59 ` 2.6.23-rc2-mm2: possible irq lock inversion dependency detected Mariusz Kozlowski
2007-08-10  8:18 ` 2.6.23-rc2-mm2 Dave Young
2007-08-10  8:32   ` 2.6.23-rc2-mm2 Andrew Morton
2007-08-10  8:37     ` 2.6.23-rc2-mm2 Dave Young
2007-08-10  9:52       ` 2.6.23-rc2-mm2 Dave Young
2007-08-10 11:19         ` 2.6.23-rc2-mm2 Gabriel C
2007-08-10 20:22           ` 2.6.23-rc2-mm2 -- conntrack divide error Jiri Slaby
2007-08-10  9:23 ` 2.6.23-rc2-mm2 Aurelien Jarno
2007-08-10 16:40   ` 2.6.23-rc2-mm2 Valdis.Kletnieks
2007-08-10 16:59     ` 2.6.23-rc2-mm2 Adrian Bunk
2007-08-10 17:21       ` 2.6.23-rc2-mm2 Valdis.Kletnieks
2007-08-10 17:28         ` 2.6.23-rc2-mm2 Adrian Bunk
2007-08-10 10:23 ` 2.6.23-rc2-mm2 Gabriel C
2007-08-10 11:03   ` 2.6.23-rc2-mm2 Gabriel C
2007-08-10 16:05     ` 2.6.23-rc2-mm2 Eric W. Biederman
2007-08-10 12:35   ` 2.6.23-rc2-mm2 Gabriel C
2007-08-10 16:38     ` 2.6.23-rc2-mm2 Andrew Morton
2007-08-12 15:21       ` 2.6.23-rc2-mm2 Gabriel C
2007-08-10 12:37   ` 2.6.23-rc2-mm2 Gabriel C
2007-08-10 13:20     ` [PATCH -mm] Fix some section mismatch warnings Gabriel C
2007-08-14 20:50       ` Andrew Morton
2007-08-10 19:04     ` Section mismatch warnings ( Re: 2.6.23-rc2-mm2 ) Gabriel C
2007-08-10 19:32       ` Andrew Morton
2007-08-10 12:42   ` 2.6.23-rc2-mm2 Gabriel C
2007-08-11 20:58     ` [linux-usb-devel] 2.6.23-rc2-mm2 David Brownell
2007-08-12 10:15       ` Gabriel C
2007-08-10 16:03   ` 2.6.23-rc2-mm2 Eric W. Biederman
2007-08-10 14:38 ` [-mm patch] kernel/sysctl_check.c must #include <linux/string.h> Adrian Bunk
2007-08-10 21:32   ` Eric W. Biederman
2007-08-10 14:53 ` 2.6.23-rc2-mm2 Michal Piotrowski
2007-08-10 15:05   ` 2.6.23-rc2-mm2 Michal Piotrowski
2007-08-10 16:01     ` 2.6.23-rc2-mm2 Eric W. Biederman
2007-08-10 16:05       ` 2.6.23-rc2-mm2 Ingo Molnar
2007-08-10 17:10         ` 2.6.23-rc2-mm2 Andrew Morton
2007-08-10 17:12         ` 2.6.23-rc2-mm2 Eric W. Biederman
2007-08-21 10:41           ` 2.6.23-rc2-mm2 Ingo Molnar
2007-08-10 15:56 ` 2.6.23-rc2-mm2: drivers/s390/char/keyboard.c compile error Adrian Bunk
2007-08-10 16:39   ` Samuel Thibault
2007-08-10 16:16 ` 2.6.23-rc2-mm2 Michal Piotrowski
2007-08-10 16:37   ` 2.6.23-rc2-mm2 Gabriel C
2007-08-10 17:33     ` 2.6.23-rc2-mm2 Eric W. Biederman
2007-08-10 19:41       ` 2.6.23-rc2-mm2 Andrew Morton
2007-08-10 19:54         ` 2.6.23-rc2-mm2 Eric W. Biederman
2007-08-10 21:00         ` [PATCH 1/7] sysctl: Remove broken cdrom binary sysctls Eric W. Biederman
2007-08-10 21:01           ` Eric W. Biederman [this message]
2007-08-10 21:03             ` [PATCH 3/7] sysctl: Simplify the pty sysctl logic Eric W. Biederman
2007-08-10 21:06               ` [PATCH 4/7] sysctl: remove broken netfilter binary sysctls Eric W. Biederman
2007-08-10 21:08                 ` [PATCH 5/7] sysctl: Cleanup the sched debug sysctl usage Eric W. Biederman
2007-08-10 21:09                   ` [PATCH 6/7] sysctl: Update sysctl_checks list of binary paths Eric W. Biederman
2007-08-10 21:10                     ` [PATCH 7/7] sysctl: Remove the cad_pid binary sysctl path Eric W. Biederman
2007-08-10 21:10           ` [PATCH 1/7] sysctl: Remove broken cdrom binary sysctls Alan Cox
2007-08-10 21:19         ` 2.6.23-rc2-mm2 Eric W. Biederman
2007-08-10 17:38     ` 2.6.23-rc2-mm2 Michal Piotrowski
2007-08-10 17:55 ` arch/i386/kernel/setup.c - compile error (Re: 2.6.23-rc2-mm2) Gabriel C
2007-08-10 18:44   ` Andrew Morton
2007-08-10 19:34     ` Gabriel C
2007-08-10 20:08 ` 2.6.23-rc2-mm2 Aurelien Jarno
2007-08-10 20:20   ` 2.6.23-rc2-mm2 Andrew Morton
2007-08-10 21:43     ` 2.6.23-rc2-mm2 John W. Linville
2007-08-11 22:04 ` [PATCH] Re: 2.6.23-rc2-mm2: sata disk going slow Hugh Dickins
2007-08-13  5:29 ` 2.6.23-rc2-mm2 (libertas) Randy Dunlap
2007-08-14 21:23 ` [-mm patch] unexport ide_tune_dma Adrian Bunk
2007-08-14 21:23 ` [-mm patch] AFLAGS: fix the -g setting Adrian Bunk
2007-08-16 21:02   ` Andrew Morton
2007-08-16 22:16     ` Adrian Bunk
2007-08-16 22:30       ` Roland McGrath
2007-08-14 21:25 ` [-mm patch] remove fs/ext2/balloc.c:reserve_blocks() Adrian Bunk
2007-08-14 21:26 ` [-mm patch] unexport cap_inode_killpriv Adrian Bunk
2007-08-14 21:35   ` Serge E. Hallyn
2007-08-14 23:43     ` Adrian Bunk
2007-08-19 15:56 ` 2.6.23-rc2-mm2 richard kennedy
2007-08-21 23:36   ` 2.6.23-rc2-mm2 Andrew Morton
2007-08-23 15:54     ` 2.6.23-rc2-mm2 richard kennedy

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=m1lkcjw1cc.fsf_-_@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=coreteam@netfilter.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.k.k.piotrowski@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nix.or.die@googlemail.com \
    /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®