Skip to content

Commit

Permalink
sysctl drivers: Remove dead binary sysctl support
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric W. Biederman committed Nov 12, 2009
1 parent c2a86a6 commit 894d249
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 101 deletions.
8 changes: 3 additions & 5 deletions drivers/cdrom/cdrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
9 changes: 3 additions & 6 deletions drivers/char/hpet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 3 additions & 6 deletions drivers/char/ipmi/ipmi_poweroff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 },
{ }
Expand Down
10 changes: 2 additions & 8 deletions drivers/char/pty.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
42 changes: 1 addition & 41 deletions drivers/char/random.c
Original file line number Diff line number Diff line change
Expand Up @@ -1257,94 +1257,54 @@ 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),
.mode = 0444,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = RANDOM_ENTROPY_COUNT,
.procname = "entropy_avail",
.maxlen = sizeof(int),
.mode = 0444,
.proc_handler = &proc_dointvec,
.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 */

Expand Down
9 changes: 3 additions & 6 deletions drivers/char/rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 3 additions & 8 deletions drivers/macintosh/mac_hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,54 +27,49 @@ 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),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE,
.procname = "mouse_button2_keycode",
.data = &mouse_button2_keycode,
.maxlen = sizeof(int),
.mode = 0644,
.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;
Expand Down
10 changes: 3 additions & 7 deletions drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,44 +98,40 @@ 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),
.mode = S_IRUGO|S_IWUSR,
.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;
Expand Down
Loading

0 comments on commit 894d249

Please sign in to comment.