lkml.org 
[lkml]   [2009]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 15/23] sysctl mips/lasat: Remove dead binary sysctl support
    Date
    From: Eric W. Biederman <ebiederm@xmission.com>

    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.

    Cc: Ralf Baechle <ralf@linux-mips.org>
    Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
    ---
    arch/mips/lasat/sysctl.c | 99 +---------------------------------------------
    1 files changed, 1 insertions(+), 98 deletions(-)
    diff --git a/arch/mips/lasat/sysctl.c b/arch/mips/lasat/sysctl.c
    index b3deed8..1dbdd76 100644
    --- a/arch/mips/lasat/sysctl.c
    +++ b/arch/mips/lasat/sysctl.c
    @@ -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,
    @@ -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)
    @@ -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)
    {
    @@ -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
    --
    1.6.5.2.143.g8cc62


    \
     
     \ /
      Last update: 2009-11-08 13:31    [from the cache]
    ©2003-2011 Jasper Spaans. Advertise on this site