sysctl drivers: Remove dead binary sysctl support
authorEric W. Biederman <ebiederm@xmission.com>
Thu, 5 Nov 2009 22:34:02 +0000 (14:34 -0800)
committerEric W. Biederman <ebiederm@xmission.com>
Thu, 12 Nov 2009 10:04:58 +0000 (02:04 -0800)
Now that sys_sysctl is a wrapper around /proc/sys all of
the binary sysctl support elsewhere in the tree is
dead code.

Cc: Jens Axboe <axboe@kernel.dk>
Cc: Corey Minyard <minyard@acm.org>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Matt Mackall <mpm@selenic.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Neil Brown <neilb@suse.de>
Cc: "James E.J. Bottomley" <James.Bottomley@suse.de>
Acked-by: Clemens Ladisch <clemens@ladisch.de> for drivers/char/hpet.c
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
drivers/cdrom/cdrom.c
drivers/char/hpet.c
drivers/char/ipmi/ipmi_poweroff.c
drivers/char/pty.c
drivers/char/random.c
drivers/char/rtc.c
drivers/macintosh/mac_hid.c
drivers/md/md.c
drivers/parport/procfs.c
drivers/scsi/scsi_sysctl.c

index 614da5b8613ac7d11271865bd7766a49b3ffdf7b..1872b6dc168ac5a960c19ea8b4d04e0a5ab97e89 100644 (file)
@@ -3594,30 +3594,28 @@ static ctl_table cdrom_table[] = {
                .mode           = 0644,
                .proc_handler   = &cdrom_sysctl_handler
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 static ctl_table cdrom_cdrom_table[] = {
        {
-               .ctl_name       = DEV_CDROM,
                .procname       = "cdrom",
                .maxlen         = 0,
                .mode           = 0555,
                .child          = cdrom_table,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 /* Make sure that /proc/sys/dev is there */
 static ctl_table cdrom_root_table[] = {
        {
-               .ctl_name       = CTL_DEV,
                .procname       = "dev",
                .maxlen         = 0,
                .mode           = 0555,
                .child          = cdrom_cdrom_table,
        },
-       { .ctl_name = 0 }
+       { }
 };
 static struct ctl_table_header *cdrom_sysctl_header;
 
index 70a770ac013875a3e4b5200b954a21197623e2e7..a05a6112240b9786aa136edbac9c2667cc84deb9 100644 (file)
@@ -675,36 +675,33 @@ static int hpet_is_known(struct hpet_data *hdp)
 
 static ctl_table hpet_table[] = {
        {
-        .ctl_name = CTL_UNNUMBERED,
         .procname = "max-user-freq",
         .data = &hpet_max_freq,
         .maxlen = sizeof(int),
         .mode = 0644,
         .proc_handler = &proc_dointvec,
         },
-       {.ctl_name = 0}
+       {}
 };
 
 static ctl_table hpet_root[] = {
        {
-        .ctl_name = CTL_UNNUMBERED,
         .procname = "hpet",
         .maxlen = 0,
         .mode = 0555,
         .child = hpet_table,
         },
-       {.ctl_name = 0}
+       {}
 };
 
 static ctl_table dev_root[] = {
        {
-        .ctl_name = CTL_DEV,
         .procname = "dev",
         .maxlen = 0,
         .mode = 0555,
         .child = hpet_root,
         },
-       {.ctl_name = 0}
+       {}
 };
 
 static struct ctl_table_header *sysctl_header;
index 2e66b5f773dd052ae4100b1614099f1ab300b83b..aa39722696ddce9c1d3c1e403ed78fff4fab9be4 100644 (file)
@@ -660,8 +660,7 @@ static struct ipmi_smi_watcher smi_watcher = {
 #include <linux/sysctl.h>
 
 static ctl_table ipmi_table[] = {
-       { .ctl_name     = DEV_IPMI_POWEROFF_POWERCYCLE,
-         .procname     = "poweroff_powercycle",
+       { .procname     = "poweroff_powercycle",
          .data         = &poweroff_powercycle,
          .maxlen       = sizeof(poweroff_powercycle),
          .mode         = 0644,
@@ -670,16 +669,14 @@ static ctl_table ipmi_table[] = {
 };
 
 static ctl_table ipmi_dir_table[] = {
-       { .ctl_name     = DEV_IPMI,
-         .procname     = "ipmi",
+       { .procname     = "ipmi",
          .mode         = 0555,
          .child        = ipmi_table },
        { }
 };
 
 static ctl_table ipmi_root_table[] = {
-       { .ctl_name     = CTL_DEV,
-         .procname     = "dev",
+       { .procname     = "dev",
          .mode         = 0555,
          .child        = ipmi_dir_table },
        { }
index 62f282e67638ccaa7863e2836b68645e90e77ae6..d516e9ced3c288cab118dc6ef0c2f075de05983a 100644 (file)
@@ -431,30 +431,25 @@ static struct cdev ptmx_cdev;
 
 static struct ctl_table pty_table[] = {
        {
-               .ctl_name       = PTY_MAX,
                .procname       = "max",
                .maxlen         = sizeof(int),
                .mode           = 0644,
                .data           = &pty_limit,
                .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
                .extra1         = &pty_limit_min,
                .extra2         = &pty_limit_max,
        }, {
-               .ctl_name       = PTY_NR,
                .procname       = "nr",
                .maxlen         = sizeof(int),
                .mode           = 0444,
                .data           = &pty_count,
                .proc_handler   = &proc_dointvec,
-       }, {
-               .ctl_name       = 0
-       }
+       }, 
+       {}
 };
 
 static struct ctl_table pty_kern_table[] = {
        {
-               .ctl_name       = KERN_PTY,
                .procname       = "pty",
                .mode           = 0555,
                .child          = pty_table,
@@ -464,7 +459,6 @@ static struct ctl_table pty_kern_table[] = {
 
 static struct ctl_table pty_root_table[] = {
        {
-               .ctl_name       = CTL_KERN,
                .procname       = "kernel",
                .mode           = 0555,
                .child          = pty_kern_table,
index 04b505e5a5e25da1b477218b787f6bd9f2470709..bcf680f9ff589993c499bf2e7357863fee5c2a3e 100644 (file)
@@ -1257,40 +1257,9 @@ static int proc_do_uuid(ctl_table *table, int write,
        return proc_dostring(&fake_table, write, buffer, lenp, ppos);
 }
 
-static int uuid_strategy(ctl_table *table,
-                        void __user *oldval, size_t __user *oldlenp,
-                        void __user *newval, size_t newlen)
-{
-       unsigned char tmp_uuid[16], *uuid;
-       unsigned int len;
-
-       if (!oldval || !oldlenp)
-               return 1;
-
-       uuid = table->data;
-       if (!uuid) {
-               uuid = tmp_uuid;
-               uuid[8] = 0;
-       }
-       if (uuid[8] == 0)
-               generate_random_uuid(uuid);
-
-       if (get_user(len, oldlenp))
-               return -EFAULT;
-       if (len) {
-               if (len > 16)
-                       len = 16;
-               if (copy_to_user(oldval, uuid, len) ||
-                   put_user(len, oldlenp))
-                       return -EFAULT;
-       }
-       return 1;
-}
-
 static int sysctl_poolsize = INPUT_POOL_WORDS * 32;
 ctl_table random_table[] = {
        {
-               .ctl_name       = RANDOM_POOLSIZE,
                .procname       = "poolsize",
                .data           = &sysctl_poolsize,
                .maxlen         = sizeof(int),
@@ -1298,7 +1267,6 @@ ctl_table random_table[] = {
                .proc_handler   = &proc_dointvec,
        },
        {
-               .ctl_name       = RANDOM_ENTROPY_COUNT,
                .procname       = "entropy_avail",
                .maxlen         = sizeof(int),
                .mode           = 0444,
@@ -1306,45 +1274,37 @@ ctl_table random_table[] = {
                .data           = &input_pool.entropy_count,
        },
        {
-               .ctl_name       = RANDOM_READ_THRESH,
                .procname       = "read_wakeup_threshold",
                .data           = &random_read_wakeup_thresh,
                .maxlen         = sizeof(int),
                .mode           = 0644,
                .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
                .extra1         = &min_read_thresh,
                .extra2         = &max_read_thresh,
        },
        {
-               .ctl_name       = RANDOM_WRITE_THRESH,
                .procname       = "write_wakeup_threshold",
                .data           = &random_write_wakeup_thresh,
                .maxlen         = sizeof(int),
                .mode           = 0644,
                .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
                .extra1         = &min_write_thresh,
                .extra2         = &max_write_thresh,
        },
        {
-               .ctl_name       = RANDOM_BOOT_ID,
                .procname       = "boot_id",
                .data           = &sysctl_bootid,
                .maxlen         = 16,
                .mode           = 0444,
                .proc_handler   = &proc_do_uuid,
-               .strategy       = &uuid_strategy,
        },
        {
-               .ctl_name       = RANDOM_UUID,
                .procname       = "uuid",
                .maxlen         = 16,
                .mode           = 0444,
                .proc_handler   = &proc_do_uuid,
-               .strategy       = &uuid_strategy,
        },
-       { .ctl_name = 0 }
+       { }
 };
 #endif         /* CONFIG_SYSCTL */
 
index bc4ab3e54550fb25252424e17891b99126422707..37bfe23c218e993036e392a521faa9f9597ae654 100644 (file)
@@ -282,34 +282,31 @@ static irqreturn_t rtc_interrupt(int irq, void *dev_id)
  */
 static ctl_table rtc_table[] = {
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "max-user-freq",
                .data           = &rtc_max_user_freq,
                .maxlen         = sizeof(int),
                .mode           = 0644,
                .proc_handler   = &proc_dointvec,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 static ctl_table rtc_root[] = {
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "rtc",
                .mode           = 0555,
                .child          = rtc_table,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 static ctl_table dev_root[] = {
        {
-               .ctl_name       = CTL_DEV,
                .procname       = "dev",
                .mode           = 0555,
                .child          = rtc_root,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 static struct ctl_table_header *sysctl_header;
index cc9f27514aefe99a2e45da629e76050dab48a247..2dd29b42a49ebf927a6f794b5d0f6ebbb5b02503 100644 (file)
@@ -27,7 +27,6 @@ static int mouse_last_keycode;
 /* file(s) in /proc/sys/dev/mac_hid */
 static ctl_table mac_hid_files[] = {
        {
-               .ctl_name       = DEV_MAC_HID_MOUSE_BUTTON_EMULATION,
                .procname       = "mouse_button_emulation",
                .data           = &mouse_emulate_buttons,
                .maxlen         = sizeof(int),
@@ -35,7 +34,6 @@ static ctl_table mac_hid_files[] = {
                .proc_handler   = &proc_dointvec,
        },
        {
-               .ctl_name       = DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE,
                .procname       = "mouse_button2_keycode",
                .data           = &mouse_button2_keycode,
                .maxlen         = sizeof(int),
@@ -43,38 +41,35 @@ static ctl_table mac_hid_files[] = {
                .proc_handler   = &proc_dointvec,
        },
        {
-               .ctl_name       = DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE,
                .procname       = "mouse_button3_keycode",
                .data           = &mouse_button3_keycode,
                .maxlen         = sizeof(int),
                .mode           = 0644,
                .proc_handler   = &proc_dointvec,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 /* dir in /proc/sys/dev */
 static ctl_table mac_hid_dir[] = {
        {
-               .ctl_name       = DEV_MAC_HID,
                .procname       = "mac_hid",
                .maxlen         = 0,
                .mode           = 0555,
                .child          = mac_hid_files,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 /* /proc/sys/dev itself, in case that is not there yet */
 static ctl_table mac_hid_root_dir[] = {
        {
-               .ctl_name       = CTL_DEV,
                .procname       = "dev",
                .maxlen         = 0,
                .mode           = 0555,
                .child          = mac_hid_dir,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 static struct ctl_table_header *mac_hid_sysctl_header;
index 10eb1fce975e9bde28f3331f5b9800ca8d1130ca..e9cad8889cf9b1e6a0f907997acf898cacbe45e4 100644 (file)
@@ -98,7 +98,6 @@ static struct ctl_table_header *raid_table_header;
 
 static ctl_table raid_table[] = {
        {
-               .ctl_name       = DEV_RAID_SPEED_LIMIT_MIN,
                .procname       = "speed_limit_min",
                .data           = &sysctl_speed_limit_min,
                .maxlen         = sizeof(int),
@@ -106,36 +105,33 @@ static ctl_table raid_table[] = {
                .proc_handler   = &proc_dointvec,
        },
        {
-               .ctl_name       = DEV_RAID_SPEED_LIMIT_MAX,
                .procname       = "speed_limit_max",
                .data           = &sysctl_speed_limit_max,
                .maxlen         = sizeof(int),
                .mode           = S_IRUGO|S_IWUSR,
                .proc_handler   = &proc_dointvec,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 static ctl_table raid_dir_table[] = {
        {
-               .ctl_name       = DEV_RAID,
                .procname       = "raid",
                .maxlen         = 0,
                .mode           = S_IRUGO|S_IXUGO,
                .child          = raid_table,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 static ctl_table raid_root_table[] = {
        {
-               .ctl_name       = CTL_DEV,
                .procname       = "dev",
                .maxlen         = 0,
                .mode           = 0555,
                .child          = raid_dir_table,
        },
-       { .ctl_name = 0 }
+       {  }
 };
 
 static const struct block_device_operations md_fops;
index 8eefe56f1cbe8d470b580f2f5ca1dfe2f97027e2..f808bdbf1772657ae6ae94a155a5bbd9895f23fe 100644 (file)
@@ -233,10 +233,10 @@ static int do_hardware_modes (ctl_table *table, int write,
        return copy_to_user(result, buffer, len) ? -EFAULT : 0;
 }
 
-#define PARPORT_PORT_DIR(CHILD) { .ctl_name = 0, .procname = NULL, .mode = 0555, .child = CHILD }
-#define PARPORT_PARPORT_DIR(CHILD) { .ctl_name = DEV_PARPORT, .procname = "parport", \
+#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) { .ctl_name = CTL_DEV, .procname = "dev", .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 }
 
@@ -393,7 +393,6 @@ parport_device_sysctl_template = {
        },
        {
                {
-                       .ctl_name       = 0,
                        .procname       = NULL,
                        .data           = NULL,
                        .maxlen         = 0,
@@ -455,7 +454,6 @@ parport_default_sysctl_table = {
        },
        {
                {
-                       .ctl_name       = DEV_PARPORT_DEFAULT,
                        .procname       = "default",
                        .mode           = 0555,
                        .child          = parport_default_sysctl_table.vars
@@ -495,7 +493,6 @@ 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 = 0;
 
        t->port_dir[0].child = t->vars;
        t->parport_dir[0].child = t->port_dir;
@@ -534,11 +531,9 @@ 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 = 0;
        t->port_dir[0].child = t->devices_root_dir;
        t->devices_root_dir[0].child = t->device_dir;
 
-       t->device_dir[0].ctl_name = 0;
        t->device_dir[0].procname = device->name;
        t->device_dir[0].child = t->vars;
        t->vars[0].data = &device->timeslice;
index 63a30f566f3a538c15894e2adf6805d6503308a1..42c31bee71132e9d6c2b75650373186d583d8c86 100644 (file)
@@ -13,8 +13,7 @@
 
 
 static ctl_table scsi_table[] = {
-       { .ctl_name     = DEV_SCSI_LOGGING_LEVEL,
-         .procname     = "logging_level",
+       { .procname     = "logging_level",
          .data         = &scsi_logging_level,
          .maxlen       = sizeof(scsi_logging_level),
          .mode         = 0644,
@@ -23,16 +22,14 @@ static ctl_table scsi_table[] = {
 };
 
 static ctl_table scsi_dir_table[] = {
-       { .ctl_name     = DEV_SCSI,
-         .procname     = "scsi",
+       { .procname     = "scsi",
          .mode         = 0555,
          .child        = scsi_table },
        { }
 };
 
 static ctl_table scsi_root_table[] = {
-       { .ctl_name     = CTL_DEV,
-         .procname     = "dev",
+       { .procname     = "dev",
          .mode         = 0555,
          .child        = scsi_dir_table },
        { }