Skip to content

Commit 8d65af7

Browse files
Alexey Dobriyantorvalds
authored andcommitted
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>
1 parent c0d0787 commit 8d65af7

60 files changed

Lines changed: 239 additions & 270 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/frv/kernel/pm.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ static int user_atoi(char __user *ubuf, size_t len)
150150
/*
151151
* Send us to sleep.
152152
*/
153-
static int sysctl_pm_do_suspend(ctl_table *ctl, int write, struct file *filp,
153+
static int sysctl_pm_do_suspend(ctl_table *ctl, int write,
154154
void __user *buffer, size_t *lenp, loff_t *fpos)
155155
{
156156
int retval, mode;
@@ -198,13 +198,13 @@ static int try_set_cmode(int new_cmode)
198198
}
199199

200200

201-
static int cmode_procctl(ctl_table *ctl, int write, struct file *filp,
201+
static int cmode_procctl(ctl_table *ctl, int write,
202202
void __user *buffer, size_t *lenp, loff_t *fpos)
203203
{
204204
int new_cmode;
205205

206206
if (!write)
207-
return proc_dointvec(ctl, write, filp, buffer, lenp, fpos);
207+
return proc_dointvec(ctl, write, buffer, lenp, fpos);
208208

209209
new_cmode = user_atoi(buffer, *lenp);
210210

@@ -301,13 +301,13 @@ static int try_set_cm(int new_cm)
301301
return 0;
302302
}
303303

304-
static int p0_procctl(ctl_table *ctl, int write, struct file *filp,
304+
static int p0_procctl(ctl_table *ctl, int write,
305305
void __user *buffer, size_t *lenp, loff_t *fpos)
306306
{
307307
int new_p0;
308308

309309
if (!write)
310-
return proc_dointvec(ctl, write, filp, buffer, lenp, fpos);
310+
return proc_dointvec(ctl, write, buffer, lenp, fpos);
311311

312312
new_p0 = user_atoi(buffer, *lenp);
313313

@@ -345,13 +345,13 @@ static int p0_sysctl(ctl_table *table,
345345
return 1;
346346
}
347347

348-
static int cm_procctl(ctl_table *ctl, int write, struct file *filp,
348+
static int cm_procctl(ctl_table *ctl, int write,
349349
void __user *buffer, size_t *lenp, loff_t *fpos)
350350
{
351351
int new_cm;
352352

353353
if (!write)
354-
return proc_dointvec(ctl, write, filp, buffer, lenp, fpos);
354+
return proc_dointvec(ctl, write, buffer, lenp, fpos);
355355

356356
new_cm = user_atoi(buffer, *lenp);
357357

‎arch/mips/lasat/sysctl.c‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ int sysctl_lasatstring(ctl_table *table,
5656

5757

5858
/* And the same for proc */
59-
int proc_dolasatstring(ctl_table *table, int write, struct file *filp,
59+
int proc_dolasatstring(ctl_table *table, int write,
6060
void *buffer, size_t *lenp, loff_t *ppos)
6161
{
6262
int r;
6363

64-
r = proc_dostring(table, write, filp, buffer, lenp, ppos);
64+
r = proc_dostring(table, write, buffer, lenp, ppos);
6565
if ((!write) || r)
6666
return r;
6767

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

7373
/* proc function to write EEPROM after changing int entry */
74-
int proc_dolasatint(ctl_table *table, int write, struct file *filp,
74+
int proc_dolasatint(ctl_table *table, int write,
7575
void *buffer, size_t *lenp, loff_t *ppos)
7676
{
7777
int r;
7878

79-
r = proc_dointvec(table, write, filp, buffer, lenp, ppos);
79+
r = proc_dointvec(table, write, buffer, lenp, ppos);
8080
if ((!write) || r)
8181
return r;
8282

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

9191
/* proc function to read/write RealTime Clock */
92-
int proc_dolasatrtc(ctl_table *table, int write, struct file *filp,
92+
int proc_dolasatrtc(ctl_table *table, int write,
9393
void *buffer, size_t *lenp, loff_t *ppos)
9494
{
9595
struct timespec ts;
@@ -102,7 +102,7 @@ int proc_dolasatrtc(ctl_table *table, int write, struct file *filp,
102102
if (rtctmp < 0)
103103
rtctmp = 0;
104104
}
105-
r = proc_dointvec(table, write, filp, buffer, lenp, ppos);
105+
r = proc_dointvec(table, write, buffer, lenp, ppos);
106106
if (r)
107107
return r;
108108

@@ -154,7 +154,7 @@ int sysctl_lasat_rtc(ctl_table *table,
154154
#endif
155155

156156
#ifdef CONFIG_INET
157-
int proc_lasat_ip(ctl_table *table, int write, struct file *filp,
157+
int proc_lasat_ip(ctl_table *table, int write,
158158
void *buffer, size_t *lenp, loff_t *ppos)
159159
{
160160
unsigned int ip;
@@ -231,12 +231,12 @@ static int sysctl_lasat_prid(ctl_table *table,
231231
return 0;
232232
}
233233

234-
int proc_lasat_prid(ctl_table *table, int write, struct file *filp,
234+
int proc_lasat_prid(ctl_table *table, int write,
235235
void *buffer, size_t *lenp, loff_t *ppos)
236236
{
237237
int r;
238238

239-
r = proc_dointvec(table, write, filp, buffer, lenp, ppos);
239+
r = proc_dointvec(table, write, buffer, lenp, ppos);
240240
if (r < 0)
241241
return r;
242242
if (write) {

‎arch/s390/appldata/appldata_base.c‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,9 @@ static struct platform_device *appldata_pdev;
5050
* /proc entries (sysctl)
5151
*/
5252
static const char appldata_proc_name[APPLDATA_PROC_NAME_LENGTH] = "appldata";
53-
static int appldata_timer_handler(ctl_table *ctl, int write, struct file *filp,
53+
static int appldata_timer_handler(ctl_table *ctl, int write,
5454
void __user *buffer, size_t *lenp, loff_t *ppos);
5555
static int appldata_interval_handler(ctl_table *ctl, int write,
56-
struct file *filp,
5756
void __user *buffer,
5857
size_t *lenp, loff_t *ppos);
5958

@@ -247,7 +246,7 @@ __appldata_vtimer_setup(int cmd)
247246
* Start/Stop timer, show status of timer (0 = not active, 1 = active)
248247
*/
249248
static int
250-
appldata_timer_handler(ctl_table *ctl, int write, struct file *filp,
249+
appldata_timer_handler(ctl_table *ctl, int write,
251250
void __user *buffer, size_t *lenp, loff_t *ppos)
252251
{
253252
int len;
@@ -289,7 +288,7 @@ appldata_timer_handler(ctl_table *ctl, int write, struct file *filp,
289288
* current timer interval.
290289
*/
291290
static int
292-
appldata_interval_handler(ctl_table *ctl, int write, struct file *filp,
291+
appldata_interval_handler(ctl_table *ctl, int write,
293292
void __user *buffer, size_t *lenp, loff_t *ppos)
294293
{
295294
int len, interval;
@@ -335,7 +334,7 @@ appldata_interval_handler(ctl_table *ctl, int write, struct file *filp,
335334
* monitoring (0 = not in process, 1 = in process)
336335
*/
337336
static int
338-
appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
337+
appldata_generic_handler(ctl_table *ctl, int write,
339338
void __user *buffer, size_t *lenp, loff_t *ppos)
340339
{
341340
struct appldata_ops *ops = NULL, *tmp_ops;

‎arch/s390/kernel/debug.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -881,11 +881,11 @@ static int debug_active=1;
881881
* if debug_active is already off
882882
*/
883883
static int
884-
s390dbf_procactive(ctl_table *table, int write, struct file *filp,
884+
s390dbf_procactive(ctl_table *table, int write,
885885
void __user *buffer, size_t *lenp, loff_t *ppos)
886886
{
887887
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);
889889
else
890890
return 0;
891891
}

‎arch/s390/mm/cmm.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ cmm_skip_blanks(char *cp, char **endp)
262262
static struct ctl_table cmm_table[];
263263

264264
static int
265-
cmm_pages_handler(ctl_table *ctl, int write, struct file *filp,
265+
cmm_pages_handler(ctl_table *ctl, int write,
266266
void __user *buffer, size_t *lenp, loff_t *ppos)
267267
{
268268
char buf[16], *p;
@@ -303,7 +303,7 @@ cmm_pages_handler(ctl_table *ctl, int write, struct file *filp,
303303
}
304304

305305
static int
306-
cmm_timeout_handler(ctl_table *ctl, int write, struct file *filp,
306+
cmm_timeout_handler(ctl_table *ctl, int write,
307307
void __user *buffer, size_t *lenp, loff_t *ppos)
308308
{
309309
char buf[64], *p;

‎arch/x86/include/asm/nmi.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ extern unsigned int nmi_watchdog;
4040
#define NMI_INVALID 3
4141

4242
struct ctl_table;
43-
struct file;
44-
extern int proc_nmi_enabled(struct ctl_table *, int , struct file *,
43+
extern int proc_nmi_enabled(struct ctl_table *, int ,
4544
void __user *, size_t *, loff_t *);
4645
extern int unknown_nmi_panic;
4746

‎arch/x86/kernel/apic/nmi.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,14 +508,14 @@ static int unknown_nmi_panic_callback(struct pt_regs *regs, int cpu)
508508
/*
509509
* proc handler for /proc/sys/kernel/nmi
510510
*/
511-
int proc_nmi_enabled(struct ctl_table *table, int write, struct file *file,
511+
int proc_nmi_enabled(struct ctl_table *table, int write,
512512
void __user *buffer, size_t *length, loff_t *ppos)
513513
{
514514
int old_state;
515515

516516
nmi_watchdog_enabled = (atomic_read(&nmi_active) > 0) ? 1 : 0;
517517
old_state = nmi_watchdog_enabled;
518-
proc_dointvec(table, write, file, buffer, length, ppos);
518+
proc_dointvec(table, write, buffer, length, ppos);
519519
if (!!old_state == !!nmi_watchdog_enabled)
520520
return 0;
521521

‎arch/x86/kernel/vsyscall_64.c‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -228,19 +228,11 @@ static long __vsyscall(3) venosys_1(void)
228228
}
229229

230230
#ifdef CONFIG_SYSCTL
231-
232-
static int
233-
vsyscall_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-
239231
static ctl_table kernel_table2[] = {
240232
{ .procname = "vsyscall64",
241233
.data = &vsyscall_gtod_data.sysctl_enabled, .maxlen = sizeof(int),
242234
.mode = 0644,
243-
.proc_handler = vsyscall_sysctl_change },
235+
.proc_handler = proc_dointvec },
244236
{}
245237
};
246238

‎drivers/cdrom/cdrom.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3412,7 +3412,7 @@ static int cdrom_print_info(const char *header, int val, char *info,
34123412
return 0;
34133413
}
34143414

3415-
static int cdrom_sysctl_info(ctl_table *ctl, int write, struct file * filp,
3415+
static int cdrom_sysctl_info(ctl_table *ctl, int write,
34163416
void __user *buffer, size_t *lenp, loff_t *ppos)
34173417
{
34183418
int pos;
@@ -3489,7 +3489,7 @@ static int cdrom_sysctl_info(ctl_table *ctl, int write, struct file * filp,
34893489
goto done;
34903490
doit:
34913491
mutex_unlock(&cdrom_mutex);
3492-
return proc_dostring(ctl, write, filp, buffer, lenp, ppos);
3492+
return proc_dostring(ctl, write, buffer, lenp, ppos);
34933493
done:
34943494
printk(KERN_INFO "cdrom: info buffer too small\n");
34953495
goto doit;
@@ -3525,12 +3525,12 @@ static void cdrom_update_settings(void)
35253525
mutex_unlock(&cdrom_mutex);
35263526
}
35273527

3528-
static int cdrom_sysctl_handler(ctl_table *ctl, int write, struct file * filp,
3528+
static int cdrom_sysctl_handler(ctl_table *ctl, int write,
35293529
void __user *buffer, size_t *lenp, loff_t *ppos)
35303530
{
35313531
int ret;
35323532

3533-
ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
3533+
ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
35343534

35353535
if (write) {
35363536

‎drivers/char/random.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,7 @@ static char sysctl_bootid[16];
12311231
* as an ASCII string in the standard UUID format. If accesses via the
12321232
* sysctl system call, it is returned as 16 bytes of binary data.
12331233
*/
1234-
static int proc_do_uuid(ctl_table *table, int write, struct file *filp,
1234+
static int proc_do_uuid(ctl_table *table, int write,
12351235
void __user *buffer, size_t *lenp, loff_t *ppos)
12361236
{
12371237
ctl_table fake_table;
@@ -1254,7 +1254,7 @@ static int proc_do_uuid(ctl_table *table, int write, struct file *filp,
12541254
fake_table.data = buf;
12551255
fake_table.maxlen = sizeof(buf);
12561256

1257-
return proc_dostring(&fake_table, write, filp, buffer, lenp, ppos);
1257+
return proc_dostring(&fake_table, write, buffer, lenp, ppos);
12581258
}
12591259

12601260
static int uuid_strategy(ctl_table *table,

0 commit comments

Comments
 (0)