Skip to content

Commit

Permalink
sysctl: remove "struct file *" argument of ->proc_handler
Browse files Browse the repository at this point in the history
It's unused.

It isn't needed -- read or write flag is already passed and sysctl
shouldn't care about the rest.

It _was_ used in two places at arch/frv for some reason.

Signed-off-by: Alexey Dobriyan <[email protected]>
Cc: David Howells <[email protected]>
Cc: "Eric W. Biederman" <[email protected]>
Cc: Al Viro <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Martin Schwidefsky <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: James Morris <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Alexey Dobriyan authored and torvalds committed Sep 24, 2009
1 parent c0d0787 commit 8d65af7
Show file tree
Hide file tree
Showing 60 changed files with 239 additions and 270 deletions.
14 changes: 7 additions & 7 deletions arch/frv/kernel/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ static int user_atoi(char __user *ubuf, size_t len)
/*
* Send us to sleep.
*/
static int sysctl_pm_do_suspend(ctl_table *ctl, int write, struct file *filp,
static int sysctl_pm_do_suspend(ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *fpos)
{
int retval, mode;
Expand Down Expand Up @@ -198,13 +198,13 @@ static int try_set_cmode(int new_cmode)
}


static int cmode_procctl(ctl_table *ctl, int write, struct file *filp,
static int cmode_procctl(ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *fpos)
{
int new_cmode;

if (!write)
return proc_dointvec(ctl, write, filp, buffer, lenp, fpos);
return proc_dointvec(ctl, write, buffer, lenp, fpos);

new_cmode = user_atoi(buffer, *lenp);

Expand Down Expand Up @@ -301,13 +301,13 @@ static int try_set_cm(int new_cm)
return 0;
}

static int p0_procctl(ctl_table *ctl, int write, struct file *filp,
static int p0_procctl(ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *fpos)
{
int new_p0;

if (!write)
return proc_dointvec(ctl, write, filp, buffer, lenp, fpos);
return proc_dointvec(ctl, write, buffer, lenp, fpos);

new_p0 = user_atoi(buffer, *lenp);

Expand Down Expand Up @@ -345,13 +345,13 @@ static int p0_sysctl(ctl_table *table,
return 1;
}

static int cm_procctl(ctl_table *ctl, int write, struct file *filp,
static int cm_procctl(ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *fpos)
{
int new_cm;

if (!write)
return proc_dointvec(ctl, write, filp, buffer, lenp, fpos);
return proc_dointvec(ctl, write, buffer, lenp, fpos);

new_cm = user_atoi(buffer, *lenp);

Expand Down
18 changes: 9 additions & 9 deletions arch/mips/lasat/sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ int sysctl_lasatstring(ctl_table *table,


/* And the same for proc */
int proc_dolasatstring(ctl_table *table, int write, struct file *filp,
int proc_dolasatstring(ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos)
{
int r;

r = proc_dostring(table, write, filp, buffer, lenp, ppos);
r = proc_dostring(table, write, buffer, lenp, ppos);
if ((!write) || r)
return r;

Expand All @@ -71,12 +71,12 @@ int proc_dolasatstring(ctl_table *table, int write, struct file *filp,
}

/* proc function to write EEPROM after changing int entry */
int proc_dolasatint(ctl_table *table, int write, struct file *filp,
int proc_dolasatint(ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos)
{
int r;

r = proc_dointvec(table, write, filp, buffer, lenp, ppos);
r = proc_dointvec(table, write, buffer, lenp, ppos);
if ((!write) || r)
return r;

Expand All @@ -89,7 +89,7 @@ int proc_dolasatint(ctl_table *table, int write, struct file *filp,
static int rtctmp;

/* proc function to read/write RealTime Clock */
int proc_dolasatrtc(ctl_table *table, int write, struct file *filp,
int proc_dolasatrtc(ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos)
{
struct timespec ts;
Expand All @@ -102,7 +102,7 @@ int proc_dolasatrtc(ctl_table *table, int write, struct file *filp,
if (rtctmp < 0)
rtctmp = 0;
}
r = proc_dointvec(table, write, filp, buffer, lenp, ppos);
r = proc_dointvec(table, write, buffer, lenp, ppos);
if (r)
return r;

Expand Down Expand Up @@ -154,7 +154,7 @@ int sysctl_lasat_rtc(ctl_table *table,
#endif

#ifdef CONFIG_INET
int proc_lasat_ip(ctl_table *table, int write, struct file *filp,
int proc_lasat_ip(ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos)
{
unsigned int ip;
Expand Down Expand Up @@ -231,12 +231,12 @@ static int sysctl_lasat_prid(ctl_table *table,
return 0;
}

int proc_lasat_prid(ctl_table *table, int write, struct file *filp,
int proc_lasat_prid(ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos)
{
int r;

r = proc_dointvec(table, write, filp, buffer, lenp, ppos);
r = proc_dointvec(table, write, buffer, lenp, ppos);
if (r < 0)
return r;
if (write) {
Expand Down
9 changes: 4 additions & 5 deletions arch/s390/appldata/appldata_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,9 @@ static struct platform_device *appldata_pdev;
* /proc entries (sysctl)
*/
static const char appldata_proc_name[APPLDATA_PROC_NAME_LENGTH] = "appldata";
static int appldata_timer_handler(ctl_table *ctl, int write, struct file *filp,
static int appldata_timer_handler(ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos);
static int appldata_interval_handler(ctl_table *ctl, int write,
struct file *filp,
void __user *buffer,
size_t *lenp, loff_t *ppos);

Expand Down Expand Up @@ -247,7 +246,7 @@ __appldata_vtimer_setup(int cmd)
* Start/Stop timer, show status of timer (0 = not active, 1 = active)
*/
static int
appldata_timer_handler(ctl_table *ctl, int write, struct file *filp,
appldata_timer_handler(ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
int len;
Expand Down Expand Up @@ -289,7 +288,7 @@ appldata_timer_handler(ctl_table *ctl, int write, struct file *filp,
* current timer interval.
*/
static int
appldata_interval_handler(ctl_table *ctl, int write, struct file *filp,
appldata_interval_handler(ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
int len, interval;
Expand Down Expand Up @@ -335,7 +334,7 @@ appldata_interval_handler(ctl_table *ctl, int write, struct file *filp,
* monitoring (0 = not in process, 1 = in process)
*/
static int
appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
appldata_generic_handler(ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct appldata_ops *ops = NULL, *tmp_ops;
Expand Down
4 changes: 2 additions & 2 deletions arch/s390/kernel/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -881,11 +881,11 @@ static int debug_active=1;
* if debug_active is already off
*/
static int
s390dbf_procactive(ctl_table *table, int write, struct file *filp,
s390dbf_procactive(ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
if (!write || debug_stoppable || !debug_active)
return proc_dointvec(table, write, filp, buffer, lenp, ppos);
return proc_dointvec(table, write, buffer, lenp, ppos);
else
return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions arch/s390/mm/cmm.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ cmm_skip_blanks(char *cp, char **endp)
static struct ctl_table cmm_table[];

static int
cmm_pages_handler(ctl_table *ctl, int write, struct file *filp,
cmm_pages_handler(ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
char buf[16], *p;
Expand Down Expand Up @@ -303,7 +303,7 @@ cmm_pages_handler(ctl_table *ctl, int write, struct file *filp,
}

static int
cmm_timeout_handler(ctl_table *ctl, int write, struct file *filp,
cmm_timeout_handler(ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
char buf[64], *p;
Expand Down
3 changes: 1 addition & 2 deletions arch/x86/include/asm/nmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ extern unsigned int nmi_watchdog;
#define NMI_INVALID 3

struct ctl_table;
struct file;
extern int proc_nmi_enabled(struct ctl_table *, int , struct file *,
extern int proc_nmi_enabled(struct ctl_table *, int ,
void __user *, size_t *, loff_t *);
extern int unknown_nmi_panic;

Expand Down
4 changes: 2 additions & 2 deletions arch/x86/kernel/apic/nmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,14 +508,14 @@ static int unknown_nmi_panic_callback(struct pt_regs *regs, int cpu)
/*
* proc handler for /proc/sys/kernel/nmi
*/
int proc_nmi_enabled(struct ctl_table *table, int write, struct file *file,
int proc_nmi_enabled(struct ctl_table *table, int write,
void __user *buffer, size_t *length, loff_t *ppos)
{
int old_state;

nmi_watchdog_enabled = (atomic_read(&nmi_active) > 0) ? 1 : 0;
old_state = nmi_watchdog_enabled;
proc_dointvec(table, write, file, buffer, length, ppos);
proc_dointvec(table, write, buffer, length, ppos);
if (!!old_state == !!nmi_watchdog_enabled)
return 0;

Expand Down
10 changes: 1 addition & 9 deletions arch/x86/kernel/vsyscall_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,19 +228,11 @@ static long __vsyscall(3) venosys_1(void)
}

#ifdef CONFIG_SYSCTL

static int
vsyscall_sysctl_change(ctl_table *ctl, int write, struct file * filp,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
return proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
}

static ctl_table kernel_table2[] = {
{ .procname = "vsyscall64",
.data = &vsyscall_gtod_data.sysctl_enabled, .maxlen = sizeof(int),
.mode = 0644,
.proc_handler = vsyscall_sysctl_change },
.proc_handler = proc_dointvec },
{}
};

Expand Down
8 changes: 4 additions & 4 deletions drivers/cdrom/cdrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -3412,7 +3412,7 @@ static int cdrom_print_info(const char *header, int val, char *info,
return 0;
}

static int cdrom_sysctl_info(ctl_table *ctl, int write, struct file * filp,
static int cdrom_sysctl_info(ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
int pos;
Expand Down Expand Up @@ -3489,7 +3489,7 @@ static int cdrom_sysctl_info(ctl_table *ctl, int write, struct file * filp,
goto done;
doit:
mutex_unlock(&cdrom_mutex);
return proc_dostring(ctl, write, filp, buffer, lenp, ppos);
return proc_dostring(ctl, write, buffer, lenp, ppos);
done:
printk(KERN_INFO "cdrom: info buffer too small\n");
goto doit;
Expand Down Expand Up @@ -3525,12 +3525,12 @@ static void cdrom_update_settings(void)
mutex_unlock(&cdrom_mutex);
}

static int cdrom_sysctl_handler(ctl_table *ctl, int write, struct file * filp,
static int cdrom_sysctl_handler(ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;

ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
ret = proc_dointvec(ctl, write, buffer, lenp, ppos);

if (write) {

Expand Down
4 changes: 2 additions & 2 deletions drivers/char/random.c
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,7 @@ static char sysctl_bootid[16];
* as an ASCII string in the standard UUID format. If accesses via the
* sysctl system call, it is returned as 16 bytes of binary data.
*/
static int proc_do_uuid(ctl_table *table, int write, struct file *filp,
static int proc_do_uuid(ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
ctl_table fake_table;
Expand All @@ -1254,7 +1254,7 @@ static int proc_do_uuid(ctl_table *table, int write, struct file *filp,
fake_table.data = buf;
fake_table.maxlen = sizeof(buf);

return proc_dostring(&fake_table, write, filp, buffer, lenp, ppos);
return proc_dostring(&fake_table, write, buffer, lenp, ppos);
}

static int uuid_strategy(ctl_table *table,
Expand Down
Loading

0 comments on commit 8d65af7

Please sign in to comment.