sysctl mips/lasat: Remove dead binary sysctl support

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

The deleted strategy routines here surprise me.  ctl_name was
CTL_UNNUMBERED so they would not have been called at all.

Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
This commit is contained in:
Eric W. Biederman 2009-04-03 04:33:48 -07:00
parent 894d249115
commit 1639319222

View file

@ -37,23 +37,6 @@
#include "ds1603.h" #include "ds1603.h"
#endif #endif
/* Strategy function to write EEPROM after changing string entry */
int sysctl_lasatstring(ctl_table *table,
void *oldval, size_t *oldlenp,
void *newval, size_t newlen)
{
int r;
r = sysctl_string(table, oldval, oldlenp, newval, newlen);
if (r < 0)
return r;
if (newval && newlen)
lasat_write_eeprom_info();
return 0;
}
/* And the same for proc */ /* And the same for proc */
int proc_dolasatstring(ctl_table *table, int write, int proc_dolasatstring(ctl_table *table, int write,
@ -113,46 +96,6 @@ int proc_dolasatrtc(ctl_table *table, int write,
} }
#endif #endif
/* Sysctl for setting the IP addresses */
int sysctl_lasat_intvec(ctl_table *table,
void *oldval, size_t *oldlenp,
void *newval, size_t newlen)
{
int r;
r = sysctl_intvec(table, oldval, oldlenp, newval, newlen);
if (r < 0)
return r;
if (newval && newlen)
lasat_write_eeprom_info();
return 0;
}
#ifdef CONFIG_DS1603
/* Same for RTC */
int sysctl_lasat_rtc(ctl_table *table,
void *oldval, size_t *oldlenp,
void *newval, size_t newlen)
{
struct timespec ts;
int r;
read_persistent_clock(&ts);
rtctmp = ts.tv_sec;
if (rtctmp < 0)
rtctmp = 0;
r = sysctl_intvec(table, oldval, oldlenp, newval, newlen);
if (r < 0)
return r;
if (newval && newlen)
rtc_mips_set_mmss(rtctmp);
return r;
}
#endif
#ifdef CONFIG_INET #ifdef CONFIG_INET
int proc_lasat_ip(ctl_table *table, int write, int proc_lasat_ip(ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos) void *buffer, size_t *lenp, loff_t *ppos)
@ -214,23 +157,6 @@ int proc_lasat_ip(ctl_table *table, int write,
} }
#endif #endif
static int sysctl_lasat_prid(ctl_table *table,
void *oldval, size_t *oldlenp,
void *newval, size_t newlen)
{
int r;
r = sysctl_intvec(table, oldval, oldlenp, newval, newlen);
if (r < 0)
return r;
if (newval && newlen) {
lasat_board_info.li_eeprom_info.prid = *(int *)newval;
lasat_write_eeprom_info();
lasat_init_board_info();
}
return 0;
}
int proc_lasat_prid(ctl_table *table, int write, int proc_lasat_prid(ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos) void *buffer, size_t *lenp, loff_t *ppos)
{ {
@ -252,115 +178,92 @@ extern int lasat_boot_to_service;
static ctl_table lasat_table[] = { static ctl_table lasat_table[] = {
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "cpu-hz", .procname = "cpu-hz",
.data = &lasat_board_info.li_cpu_hz, .data = &lasat_board_info.li_cpu_hz,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0444, .mode = 0444,
.proc_handler = &proc_dointvec, .proc_handler = &proc_dointvec,
.strategy = &sysctl_intvec
}, },
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "bus-hz", .procname = "bus-hz",
.data = &lasat_board_info.li_bus_hz, .data = &lasat_board_info.li_bus_hz,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0444, .mode = 0444,
.proc_handler = &proc_dointvec, .proc_handler = &proc_dointvec,
.strategy = &sysctl_intvec
}, },
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "bmid", .procname = "bmid",
.data = &lasat_board_info.li_bmid, .data = &lasat_board_info.li_bmid,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0444, .mode = 0444,
.proc_handler = &proc_dointvec, .proc_handler = &proc_dointvec,
.strategy = &sysctl_intvec
}, },
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "prid", .procname = "prid",
.data = &lasat_board_info.li_prid, .data = &lasat_board_info.li_prid,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_lasat_prid, .proc_handler = &proc_lasat_prid,
.strategy = &sysctl_lasat_prid . },
},
#ifdef CONFIG_INET #ifdef CONFIG_INET
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "ipaddr", .procname = "ipaddr",
.data = &lasat_board_info.li_eeprom_info.ipaddr, .data = &lasat_board_info.li_eeprom_info.ipaddr,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_lasat_ip, .proc_handler = &proc_lasat_ip,
.strategy = &sysctl_lasat_intvec
}, },
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "netmask", .procname = "netmask",
.data = &lasat_board_info.li_eeprom_info.netmask, .data = &lasat_board_info.li_eeprom_info.netmask,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_lasat_ip, .proc_handler = &proc_lasat_ip,
.strategy = &sysctl_lasat_intvec
}, },
#endif #endif
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "passwd_hash", .procname = "passwd_hash",
.data = &lasat_board_info.li_eeprom_info.passwd_hash, .data = &lasat_board_info.li_eeprom_info.passwd_hash,
.maxlen = .maxlen =
sizeof(lasat_board_info.li_eeprom_info.passwd_hash), sizeof(lasat_board_info.li_eeprom_info.passwd_hash),
.mode = 0600, .mode = 0600,
.proc_handler = &proc_dolasatstring, .proc_handler = &proc_dolasatstring,
.strategy = &sysctl_lasatstring
}, },
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "boot-service", .procname = "boot-service",
.data = &lasat_boot_to_service, .data = &lasat_boot_to_service,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec, .proc_handler = &proc_dointvec,
.strategy = &sysctl_intvec
}, },
#ifdef CONFIG_DS1603 #ifdef CONFIG_DS1603
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "rtc", .procname = "rtc",
.data = &rtctmp, .data = &rtctmp,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dolasatrtc, .proc_handler = &proc_dolasatrtc,
.strategy = &sysctl_lasat_rtc
}, },
#endif #endif
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "namestr", .procname = "namestr",
.data = &lasat_board_info.li_namestr, .data = &lasat_board_info.li_namestr,
.maxlen = sizeof(lasat_board_info.li_namestr), .maxlen = sizeof(lasat_board_info.li_namestr),
.mode = 0444, .mode = 0444,
.proc_handler = &proc_dostring, .proc_handler = &proc_dostring,
.strategy = &sysctl_string
}, },
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "typestr", .procname = "typestr",
.data = &lasat_board_info.li_typestr, .data = &lasat_board_info.li_typestr,
.maxlen = sizeof(lasat_board_info.li_typestr), .maxlen = sizeof(lasat_board_info.li_typestr),
.mode = 0444, .mode = 0444,
.proc_handler = &proc_dostring, .proc_handler = &proc_dostring,
.strategy = &sysctl_string
}, },
{} {}
}; };
static ctl_table lasat_root_table[] = { static ctl_table lasat_root_table[] = {
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "lasat", .procname = "lasat",
.mode = 0555, .mode = 0555,
.child = lasat_table .child = lasat_table