Skip to content

Commit

Permalink
sysctl mips/lasat: Remove dead binary sysctl support
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric W. Biederman committed Nov 12, 2009
1 parent 894d249 commit 1639319
Showing 1 changed file with 1 addition and 98 deletions.
99 changes: 1 addition & 98 deletions arch/mips/lasat/sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,6 @@
#include "ds1603.h"
#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 */
int proc_dolasatstring(ctl_table *table, int write,
Expand Down Expand Up @@ -113,46 +96,6 @@ int proc_dolasatrtc(ctl_table *table, int write,
}
#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
int proc_lasat_ip(ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos)
Expand Down Expand Up @@ -214,23 +157,6 @@ int proc_lasat_ip(ctl_table *table, int write,
}
#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,
void *buffer, size_t *lenp, loff_t *ppos)
{
Expand All @@ -252,115 +178,92 @@ extern int lasat_boot_to_service;

static ctl_table lasat_table[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "cpu-hz",
.data = &lasat_board_info.li_cpu_hz,
.maxlen = sizeof(int),
.mode = 0444,
.proc_handler = &proc_dointvec,
.strategy = &sysctl_intvec
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "bus-hz",
.data = &lasat_board_info.li_bus_hz,
.maxlen = sizeof(int),
.mode = 0444,
.proc_handler = &proc_dointvec,
.strategy = &sysctl_intvec
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "bmid",
.data = &lasat_board_info.li_bmid,
.maxlen = sizeof(int),
.mode = 0444,
.proc_handler = &proc_dointvec,
.strategy = &sysctl_intvec
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "prid",
.data = &lasat_board_info.li_prid,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_lasat_prid,
.strategy = &sysctl_lasat_prid
},
. },
#ifdef CONFIG_INET
{
.ctl_name = CTL_UNNUMBERED,
.procname = "ipaddr",
.data = &lasat_board_info.li_eeprom_info.ipaddr,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_lasat_ip,
.strategy = &sysctl_lasat_intvec
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "netmask",
.data = &lasat_board_info.li_eeprom_info.netmask,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_lasat_ip,
.strategy = &sysctl_lasat_intvec
},
#endif
{
.ctl_name = CTL_UNNUMBERED,
.procname = "passwd_hash",
.data = &lasat_board_info.li_eeprom_info.passwd_hash,
.maxlen =
sizeof(lasat_board_info.li_eeprom_info.passwd_hash),
.mode = 0600,
.proc_handler = &proc_dolasatstring,
.strategy = &sysctl_lasatstring
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "boot-service",
.data = &lasat_boot_to_service,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
.strategy = &sysctl_intvec
},
#ifdef CONFIG_DS1603
{
.ctl_name = CTL_UNNUMBERED,
.procname = "rtc",
.data = &rtctmp,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dolasatrtc,
.strategy = &sysctl_lasat_rtc
},
#endif
{
.ctl_name = CTL_UNNUMBERED,
.procname = "namestr",
.data = &lasat_board_info.li_namestr,
.maxlen = sizeof(lasat_board_info.li_namestr),
.mode = 0444,
.proc_handler = &proc_dostring,
.strategy = &sysctl_string
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "typestr",
.data = &lasat_board_info.li_typestr,
.maxlen = sizeof(lasat_board_info.li_typestr),
.mode = 0444,
.proc_handler = &proc_dostring,
.strategy = &sysctl_string
},
{}
};

static ctl_table lasat_root_table[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "lasat",
.mode = 0555,
.child = lasat_table
Expand Down

0 comments on commit 1639319

Please sign in to comment.