aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2009-09-23 18:57:19 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-24 10:21:04 -0400
commit8d65af789f3e2cf4cfbdbf71a0f7a61ebcd41d38 (patch)
tree121df3bfffc7853ac6d2c514ad514d4a748a0933 /arch
parentc0d0787b6d47d9f4d5e8bd321921104e854a9135 (diff)
sysctl: remove "struct file *" argument of ->proc_handler
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 <adobriyan@gmail.com> Cc: David Howells <dhowells@redhat.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: "David S. Miller" <davem@davemloft.net> Cc: James Morris <jmorris@namei.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/frv/kernel/pm.c14
-rw-r--r--arch/mips/lasat/sysctl.c18
-rw-r--r--arch/s390/appldata/appldata_base.c9
-rw-r--r--arch/s390/kernel/debug.c4
-rw-r--r--arch/s390/mm/cmm.c4
-rw-r--r--arch/x86/include/asm/nmi.h3
-rw-r--r--arch/x86/kernel/apic/nmi.c4
-rw-r--r--arch/x86/kernel/vsyscall_64.c10
8 files changed, 28 insertions, 38 deletions
diff --git a/arch/frv/kernel/pm.c b/arch/frv/kernel/pm.c
index be722fc1acff..0d4d3e3a4cfc 100644
--- a/arch/frv/kernel/pm.c
+++ b/arch/frv/kernel/pm.c
@@ -150,7 +150,7 @@ static int user_atoi(char __user *ubuf, size_t len)
150/* 150/*
151 * Send us to sleep. 151 * Send us to sleep.
152 */ 152 */
153static int sysctl_pm_do_suspend(ctl_table *ctl, int write, struct file *filp, 153static int sysctl_pm_do_suspend(ctl_table *ctl, int write,
154 void __user *buffer, size_t *lenp, loff_t *fpos) 154 void __user *buffer, size_t *lenp, loff_t *fpos)
155{ 155{
156 int retval, mode; 156 int retval, mode;
@@ -198,13 +198,13 @@ static int try_set_cmode(int new_cmode)
198} 198}
199 199
200 200
201static int cmode_procctl(ctl_table *ctl, int write, struct file *filp, 201static int cmode_procctl(ctl_table *ctl, int write,
202 void __user *buffer, size_t *lenp, loff_t *fpos) 202 void __user *buffer, size_t *lenp, loff_t *fpos)
203{ 203{
204 int new_cmode; 204 int new_cmode;
205 205
206 if (!write) 206 if (!write)
207 return proc_dointvec(ctl, write, filp, buffer, lenp, fpos); 207 return proc_dointvec(ctl, write, buffer, lenp, fpos);
208 208
209 new_cmode = user_atoi(buffer, *lenp); 209 new_cmode = user_atoi(buffer, *lenp);
210 210
@@ -301,13 +301,13 @@ static int try_set_cm(int new_cm)
301 return 0; 301 return 0;
302} 302}
303 303
304static int p0_procctl(ctl_table *ctl, int write, struct file *filp, 304static int p0_procctl(ctl_table *ctl, int write,
305 void __user *buffer, size_t *lenp, loff_t *fpos) 305 void __user *buffer, size_t *lenp, loff_t *fpos)
306{ 306{
307 int new_p0; 307 int new_p0;
308 308
309 if (!write) 309 if (!write)
310 return proc_dointvec(ctl, write, filp, buffer, lenp, fpos); 310 return proc_dointvec(ctl, write, buffer, lenp, fpos);
311 311
312 new_p0 = user_atoi(buffer, *lenp); 312 new_p0 = user_atoi(buffer, *lenp);
313 313
@@ -345,13 +345,13 @@ static int p0_sysctl(ctl_table *table,
345 return 1; 345 return 1;
346} 346}
347 347
348static int cm_procctl(ctl_table *ctl, int write, struct file *filp, 348static int cm_procctl(ctl_table *ctl, int write,
349 void __user *buffer, size_t *lenp, loff_t *fpos) 349 void __user *buffer, size_t *lenp, loff_t *fpos)
350{ 350{
351 int new_cm; 351 int new_cm;
352 352
353 if (!write) 353 if (!write)
354 return proc_dointvec(ctl, write, filp, buffer, lenp, fpos); 354 return proc_dointvec(ctl, write, buffer, lenp, fpos);
355 355
356 new_cm = user_atoi(buffer, *lenp); 356 new_cm = user_atoi(buffer, *lenp);
357 357
diff --git a/arch/mips/lasat/sysctl.c b/arch/mips/lasat/sysctl.c
index 3f04d4c406b7..b3deed8db619 100644
--- a/arch/mips/lasat/sysctl.c
+++ b/arch/mips/lasat/sysctl.c
@@ -56,12 +56,12 @@ int sysctl_lasatstring(ctl_table *table,
56 56
57 57
58/* And the same for proc */ 58/* And the same for proc */
59int proc_dolasatstring(ctl_table *table, int write, struct file *filp, 59int proc_dolasatstring(ctl_table *table, int write,
60 void *buffer, size_t *lenp, loff_t *ppos) 60 void *buffer, size_t *lenp, loff_t *ppos)
61{ 61{
62 int r; 62 int r;
63 63
64 r = proc_dostring(table, write, filp, buffer, lenp, ppos); 64 r = proc_dostring(table, write, buffer, lenp, ppos);
65 if ((!write) || r) 65 if ((!write) || r)
66 return r; 66 return r;
67 67
@@ -71,12 +71,12 @@ int proc_dolasatstring(ctl_table *table, int write, struct file *filp,
71} 71}
72 72
73/* proc function to write EEPROM after changing int entry */ 73/* proc function to write EEPROM after changing int entry */
74int proc_dolasatint(ctl_table *table, int write, struct file *filp, 74int proc_dolasatint(ctl_table *table, int write,
75 void *buffer, size_t *lenp, loff_t *ppos) 75 void *buffer, size_t *lenp, loff_t *ppos)
76{ 76{
77 int r; 77 int r;
78 78
79 r = proc_dointvec(table, write, filp, buffer, lenp, ppos); 79 r = proc_dointvec(table, write, buffer, lenp, ppos);
80 if ((!write) || r) 80 if ((!write) || r)
81 return r; 81 return r;
82 82
@@ -89,7 +89,7 @@ int proc_dolasatint(ctl_table *table, int write, struct file *filp,
89static int rtctmp; 89static int rtctmp;
90 90
91/* proc function to read/write RealTime Clock */ 91/* proc function to read/write RealTime Clock */
92int proc_dolasatrtc(ctl_table *table, int write, struct file *filp, 92int proc_dolasatrtc(ctl_table *table, int write,
93 void *buffer, size_t *lenp, loff_t *ppos) 93 void *buffer, size_t *lenp, loff_t *ppos)
94{ 94{
95 struct timespec ts; 95 struct timespec ts;
@@ -102,7 +102,7 @@ int proc_dolasatrtc(ctl_table *table, int write, struct file *filp,
102 if (rtctmp < 0) 102 if (rtctmp < 0)
103 rtctmp = 0; 103 rtctmp = 0;
104 } 104 }
105 r = proc_dointvec(table, write, filp, buffer, lenp, ppos); 105 r = proc_dointvec(table, write, buffer, lenp, ppos);
106 if (r) 106 if (r)
107 return r; 107 return r;
108 108
@@ -154,7 +154,7 @@ int sysctl_lasat_rtc(ctl_table *table,
154#endif 154#endif
155 155
156#ifdef CONFIG_INET 156#ifdef CONFIG_INET
157int proc_lasat_ip(ctl_table *table, int write, struct file *filp, 157int proc_lasat_ip(ctl_table *table, int write,
158 void *buffer, size_t *lenp, loff_t *ppos) 158 void *buffer, size_t *lenp, loff_t *ppos)
159{ 159{
160 unsigned int ip; 160 unsigned int ip;
@@ -231,12 +231,12 @@ static int sysctl_lasat_prid(ctl_table *table,
231 return 0; 231 return 0;
232} 232}
233 233
234int proc_lasat_prid(ctl_table *table, int write, struct file *filp, 234int proc_lasat_prid(ctl_table *table, int write,
235 void *buffer, size_t *lenp, loff_t *ppos) 235 void *buffer, size_t *lenp, loff_t *ppos)
236{ 236{
237 int r; 237 int r;
238 238
239 r = proc_dointvec(table, write, filp, buffer, lenp, ppos); 239 r = proc_dointvec(table, write, buffer, lenp, ppos);
240 if (r < 0) 240 if (r < 0)
241 return r; 241 return r;
242 if (write) { 242 if (write) {
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c
index 264528e4f58d..b55fd7ed1c31 100644
--- a/arch/s390/appldata/appldata_base.c
+++ b/arch/s390/appldata/appldata_base.c
@@ -50,10 +50,9 @@ static struct platform_device *appldata_pdev;
50 * /proc entries (sysctl) 50 * /proc entries (sysctl)
51 */ 51 */
52static const char appldata_proc_name[APPLDATA_PROC_NAME_LENGTH] = "appldata"; 52static const char appldata_proc_name[APPLDATA_PROC_NAME_LENGTH] = "appldata";
53static int appldata_timer_handler(ctl_table *ctl, int write, struct file *filp, 53static int appldata_timer_handler(ctl_table *ctl, int write,
54 void __user *buffer, size_t *lenp, loff_t *ppos); 54 void __user *buffer, size_t *lenp, loff_t *ppos);
55static int appldata_interval_handler(ctl_table *ctl, int write, 55static int appldata_interval_handler(ctl_table *ctl, int write,
56 struct file *filp,
57 void __user *buffer, 56 void __user *buffer,
58 size_t *lenp, loff_t *ppos); 57 size_t *lenp, loff_t *ppos);
59 58
@@ -247,7 +246,7 @@ __appldata_vtimer_setup(int cmd)
247 * Start/Stop timer, show status of timer (0 = not active, 1 = active) 246 * Start/Stop timer, show status of timer (0 = not active, 1 = active)
248 */ 247 */
249static int 248static int
250appldata_timer_handler(ctl_table *ctl, int write, struct file *filp, 249appldata_timer_handler(ctl_table *ctl, int write,
251 void __user *buffer, size_t *lenp, loff_t *ppos) 250 void __user *buffer, size_t *lenp, loff_t *ppos)
252{ 251{
253 int len; 252 int len;
@@ -289,7 +288,7 @@ out:
289 * current timer interval. 288 * current timer interval.
290 */ 289 */
291static int 290static int
292appldata_interval_handler(ctl_table *ctl, int write, struct file *filp, 291appldata_interval_handler(ctl_table *ctl, int write,
293 void __user *buffer, size_t *lenp, loff_t *ppos) 292 void __user *buffer, size_t *lenp, loff_t *ppos)
294{ 293{
295 int len, interval; 294 int len, interval;
@@ -335,7 +334,7 @@ out:
335 * monitoring (0 = not in process, 1 = in process) 334 * monitoring (0 = not in process, 1 = in process)
336 */ 335 */
337static int 336static int
338appldata_generic_handler(ctl_table *ctl, int write, struct file *filp, 337appldata_generic_handler(ctl_table *ctl, int write,
339 void __user *buffer, size_t *lenp, loff_t *ppos) 338 void __user *buffer, size_t *lenp, loff_t *ppos)
340{ 339{
341 struct appldata_ops *ops = NULL, *tmp_ops; 340 struct appldata_ops *ops = NULL, *tmp_ops;
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c
index 4c512561687d..20f282c911c2 100644
--- a/arch/s390/kernel/debug.c
+++ b/arch/s390/kernel/debug.c
@@ -881,11 +881,11 @@ static int debug_active=1;
881 * if debug_active is already off 881 * if debug_active is already off
882 */ 882 */
883static int 883static int
884s390dbf_procactive(ctl_table *table, int write, struct file *filp, 884s390dbf_procactive(ctl_table *table, int write,
885 void __user *buffer, size_t *lenp, loff_t *ppos) 885 void __user *buffer, size_t *lenp, loff_t *ppos)
886{ 886{
887 if (!write || debug_stoppable || !debug_active) 887 if (!write || debug_stoppable || !debug_active)
888 return proc_dointvec(table, write, filp, buffer, lenp, ppos); 888 return proc_dointvec(table, write, buffer, lenp, ppos);
889 else 889 else
890 return 0; 890 return 0;
891} 891}
diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c
index 413c240cbca7..b201135cc18c 100644
--- a/arch/s390/mm/cmm.c
+++ b/arch/s390/mm/cmm.c
@@ -262,7 +262,7 @@ cmm_skip_blanks(char *cp, char **endp)
262static struct ctl_table cmm_table[]; 262static struct ctl_table cmm_table[];
263 263
264static int 264static int
265cmm_pages_handler(ctl_table *ctl, int write, struct file *filp, 265cmm_pages_handler(ctl_table *ctl, int write,
266 void __user *buffer, size_t *lenp, loff_t *ppos) 266 void __user *buffer, size_t *lenp, loff_t *ppos)
267{ 267{
268 char buf[16], *p; 268 char buf[16], *p;
@@ -303,7 +303,7 @@ cmm_pages_handler(ctl_table *ctl, int write, struct file *filp,
303} 303}
304 304
305static int 305static int
306cmm_timeout_handler(ctl_table *ctl, int write, struct file *filp, 306cmm_timeout_handler(ctl_table *ctl, int write,
307 void __user *buffer, size_t *lenp, loff_t *ppos) 307 void __user *buffer, size_t *lenp, loff_t *ppos)
308{ 308{
309 char buf[64], *p; 309 char buf[64], *p;
diff --git a/arch/x86/include/asm/nmi.h b/arch/x86/include/asm/nmi.h
index e63cf7d441e1..139d4c1a33a7 100644
--- a/arch/x86/include/asm/nmi.h
+++ b/arch/x86/include/asm/nmi.h
@@ -40,8 +40,7 @@ extern unsigned int nmi_watchdog;
40#define NMI_INVALID 3 40#define NMI_INVALID 3
41 41
42struct ctl_table; 42struct ctl_table;
43struct file; 43extern int proc_nmi_enabled(struct ctl_table *, int ,
44extern int proc_nmi_enabled(struct ctl_table *, int , struct file *,
45 void __user *, size_t *, loff_t *); 44 void __user *, size_t *, loff_t *);
46extern int unknown_nmi_panic; 45extern int unknown_nmi_panic;
47 46
diff --git a/arch/x86/kernel/apic/nmi.c b/arch/x86/kernel/apic/nmi.c
index cb66a22d98ad..7ff61d6a188a 100644
--- a/arch/x86/kernel/apic/nmi.c
+++ b/arch/x86/kernel/apic/nmi.c
@@ -508,14 +508,14 @@ static int unknown_nmi_panic_callback(struct pt_regs *regs, int cpu)
508/* 508/*
509 * proc handler for /proc/sys/kernel/nmi 509 * proc handler for /proc/sys/kernel/nmi
510 */ 510 */
511int proc_nmi_enabled(struct ctl_table *table, int write, struct file *file, 511int proc_nmi_enabled(struct ctl_table *table, int write,
512 void __user *buffer, size_t *length, loff_t *ppos) 512 void __user *buffer, size_t *length, loff_t *ppos)
513{ 513{
514 int old_state; 514 int old_state;
515 515
516 nmi_watchdog_enabled = (atomic_read(&nmi_active) > 0) ? 1 : 0; 516 nmi_watchdog_enabled = (atomic_read(&nmi_active) > 0) ? 1 : 0;
517 old_state = nmi_watchdog_enabled; 517 old_state = nmi_watchdog_enabled;
518 proc_dointvec(table, write, file, buffer, length, ppos); 518 proc_dointvec(table, write, buffer, length, ppos);
519 if (!!old_state == !!nmi_watchdog_enabled) 519 if (!!old_state == !!nmi_watchdog_enabled)
520 return 0; 520 return 0;
521 521
diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c
index cf53a78e2dcf..8cb4974ff599 100644
--- a/arch/x86/kernel/vsyscall_64.c
+++ b/arch/x86/kernel/vsyscall_64.c
@@ -228,19 +228,11 @@ static long __vsyscall(3) venosys_1(void)
228} 228}
229 229
230#ifdef CONFIG_SYSCTL 230#ifdef CONFIG_SYSCTL
231
232static int
233vsyscall_sysctl_change(ctl_table *ctl, int write, struct file * filp,
234 void __user *buffer, size_t *lenp, loff_t *ppos)
235{
236 return proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
237}
238
239static ctl_table kernel_table2[] = { 231static ctl_table kernel_table2[] = {
240 { .procname = "vsyscall64", 232 { .procname = "vsyscall64",
241 .data = &vsyscall_gtod_data.sysctl_enabled, .maxlen = sizeof(int), 233 .data = &vsyscall_gtod_data.sysctl_enabled, .maxlen = sizeof(int),
242 .mode = 0644, 234 .mode = 0644,
243 .proc_handler = vsyscall_sysctl_change }, 235 .proc_handler = proc_dointvec },
244 {} 236 {}
245}; 237};
246 238