Skip to content

Commit

Permalink
[PATCH] sysctl: remove unused "context" param
Browse files Browse the repository at this point in the history
Signed-off-by: Alexey Dobriyan <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: David Howells <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: "Eric W. Biederman" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Alexey Dobriyan authored and Linus Torvalds committed Dec 10, 2006
1 parent 98d7340 commit 1f29bcd
Show file tree
Hide file tree
Showing 15 changed files with 55 additions and 76 deletions.
6 changes: 3 additions & 3 deletions arch/frv/kernel/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ static int cmode_procctl(ctl_table *ctl, int write, struct file *filp,

static int cmode_sysctl(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen, void **context)
void __user *newval, size_t newlen)
{
if (oldval && oldlenp) {
size_t oldlen;
Expand Down Expand Up @@ -326,7 +326,7 @@ static int p0_procctl(ctl_table *ctl, int write, struct file *filp,

static int p0_sysctl(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen, void **context)
void __user *newval, size_t newlen)
{
if (oldval && oldlenp) {
size_t oldlen;
Expand Down Expand Up @@ -370,7 +370,7 @@ static int cm_procctl(ctl_table *ctl, int write, struct file *filp,

static int cm_sysctl(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen, void **context)
void __user *newval, size_t newlen)
{
if (oldval && oldlenp) {
size_t oldlen;
Expand Down
17 changes: 8 additions & 9 deletions arch/mips/lasat/sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ static DEFINE_MUTEX(lasat_info_mutex);
/* Strategy function to write EEPROM after changing string entry */
int sysctl_lasatstring(ctl_table *table, int *name, int nlen,
void *oldval, size_t *oldlenp,
void *newval, size_t newlen, void **context)
void *newval, size_t newlen)
{
int r;
mutex_lock(&lasat_info_mutex);
r = sysctl_string(table, name,
nlen, oldval, oldlenp, newval, newlen, context);
nlen, oldval, oldlenp, newval, newlen);
if (r < 0) {
mutex_unlock(&lasat_info_mutex);
return r;
Expand Down Expand Up @@ -119,11 +119,11 @@ int proc_dolasatrtc(ctl_table *table, int write, struct file *filp,
/* Sysctl for setting the IP addresses */
int sysctl_lasat_intvec(ctl_table *table, int *name, int nlen,
void *oldval, size_t *oldlenp,
void *newval, size_t newlen, void **context)
void *newval, size_t newlen)
{
int r;
mutex_lock(&lasat_info_mutex);
r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen, context);
r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen);
if (r < 0) {
mutex_unlock(&lasat_info_mutex);
return r;
Expand All @@ -139,14 +139,14 @@ int sysctl_lasat_intvec(ctl_table *table, int *name, int nlen,
/* Same for RTC */
int sysctl_lasat_rtc(ctl_table *table, int *name, int nlen,
void *oldval, size_t *oldlenp,
void *newval, size_t newlen, void **context)
void *newval, size_t newlen)
{
int r;
mutex_lock(&lasat_info_mutex);
rtctmp = ds1603_read();
if (rtctmp < 0)
rtctmp = 0;
r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen, context);
r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen);
if (r < 0) {
mutex_unlock(&lasat_info_mutex);
return r;
Expand Down Expand Up @@ -251,13 +251,12 @@ int proc_lasat_ip(ctl_table *table, int write, struct file *filp,

static int sysctl_lasat_eeprom_value(ctl_table *table, int *name, int nlen,
void *oldval, size_t *oldlenp,
void *newval, size_t newlen,
void **context)
void *newval, size_t newlen)
{
int r;

mutex_lock(&lasat_info_mutex);
r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen, context);
r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen);
if (r < 0) {
mutex_unlock(&lasat_info_mutex);
return r;
Expand Down
3 changes: 1 addition & 2 deletions arch/x86_64/kernel/vsyscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,7 @@ static int vsyscall_sysctl_change(ctl_table *ctl, int write, struct file * filp,

static int vsyscall_sysctl_nostrat(ctl_table *t, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen,
void **context)
void __user *newval, size_t newlen)
{
return -ENOSYS;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/random.c
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@ static int proc_do_uuid(ctl_table *table, int write, struct file *filp,

static int uuid_strategy(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen, void **context)
void __user *newval, size_t newlen)
{
unsigned char tmp_uuid[16], *uuid;
unsigned int len;
Expand Down
5 changes: 2 additions & 3 deletions include/linux/sysctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -918,8 +918,7 @@ typedef struct ctl_table ctl_table;

typedef int ctl_handler (ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen,
void **context);
void __user *newval, size_t newlen);

typedef int proc_handler (ctl_table *ctl, int write, struct file * filp,
void __user *buffer, size_t *lenp, loff_t *ppos);
Expand Down Expand Up @@ -950,7 +949,7 @@ extern int do_sysctl (int __user *name, int nlen,
extern int do_sysctl_strategy (ctl_table *table,
int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen, void ** context);
void __user *newval, size_t newlen);

extern ctl_handler sysctl_string;
extern ctl_handler sysctl_intvec;
Expand Down
3 changes: 1 addition & 2 deletions include/net/ip.h
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,7 @@ int ipv4_doint_and_flush(ctl_table *ctl, int write,
size_t *lenp, loff_t *ppos);
int ipv4_doint_and_flush_strategy(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen,
void **context);
void __user *newval, size_t newlen);
#ifdef CONFIG_PROC_FS
extern int ip_misc_proc_init(void);
#endif
Expand Down
2 changes: 1 addition & 1 deletion include/net/sctp/sctp.h
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ static inline void sctp_sysctl_register(void) { return; }
static inline void sctp_sysctl_unregister(void) { return; }
static inline int sctp_sysctl_jiffies_ms(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen, void **context) {
void __user *newval, size_t newlen) {
return -ENOSYS;
}
#endif
Expand Down
47 changes: 22 additions & 25 deletions kernel/sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,20 +133,20 @@ extern int max_lock_depth;

#ifdef CONFIG_SYSCTL_SYSCALL
static int parse_table(int __user *, int, void __user *, size_t __user *,
void __user *, size_t, ctl_table *, void **);
void __user *, size_t, ctl_table *);
#endif

static int proc_do_uts_string(ctl_table *table, int write, struct file *filp,
void __user *buffer, size_t *lenp, loff_t *ppos);

static int sysctl_uts_string(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen, void **context);
void __user *newval, size_t newlen);

#ifdef CONFIG_SYSVIPC
static int sysctl_ipc_data(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen, void **context);
void __user *newval, size_t newlen);
#endif

#ifdef CONFIG_PROC_SYSCTL
Expand Down Expand Up @@ -1243,17 +1243,14 @@ int do_sysctl(int __user *name, int nlen, void __user *oldval, size_t __user *ol
do {
struct ctl_table_header *head =
list_entry(tmp, struct ctl_table_header, ctl_entry);
void *context = NULL;

if (!use_table(head))
continue;

spin_unlock(&sysctl_lock);

error = parse_table(name, nlen, oldval, oldlenp,
newval, newlen, head->ctl_table,
&context);
kfree(context);
newval, newlen, head->ctl_table);

spin_lock(&sysctl_lock);
unuse_table(head);
Expand Down Expand Up @@ -1309,7 +1306,7 @@ static inline int ctl_perm(ctl_table *table, int op)
static int parse_table(int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen,
ctl_table *table, void **context)
ctl_table *table)
{
int n;
repeat:
Expand All @@ -1329,7 +1326,7 @@ static int parse_table(int __user *name, int nlen,
error = table->strategy(
table, name, nlen,
oldval, oldlenp,
newval, newlen, context);
newval, newlen);
if (error)
return error;
}
Expand All @@ -1340,7 +1337,7 @@ static int parse_table(int __user *name, int nlen,
}
error = do_sysctl_strategy(table, name, nlen,
oldval, oldlenp,
newval, newlen, context);
newval, newlen);
return error;
}
}
Expand All @@ -1351,7 +1348,7 @@ static int parse_table(int __user *name, int nlen,
int do_sysctl_strategy (ctl_table *table,
int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen, void **context)
void __user *newval, size_t newlen)
{
int op = 0, rc;
size_t len;
Expand All @@ -1365,7 +1362,7 @@ int do_sysctl_strategy (ctl_table *table,

if (table->strategy) {
rc = table->strategy(table, name, nlen, oldval, oldlenp,
newval, newlen, context);
newval, newlen);
if (rc < 0)
return rc;
if (rc > 0)
Expand Down Expand Up @@ -2473,7 +2470,7 @@ int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int write,
/* The generic string strategy routine: */
int sysctl_string(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen, void **context)
void __user *newval, size_t newlen)
{
if (!table->data || !table->maxlen)
return -ENOTDIR;
Expand Down Expand Up @@ -2519,7 +2516,7 @@ int sysctl_string(ctl_table *table, int __user *name, int nlen,
*/
int sysctl_intvec(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen, void **context)
void __user *newval, size_t newlen)
{

if (newval && newlen) {
Expand Down Expand Up @@ -2555,7 +2552,7 @@ int sysctl_intvec(ctl_table *table, int __user *name, int nlen,
/* Strategy function to convert jiffies to seconds */
int sysctl_jiffies(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen, void **context)
void __user *newval, size_t newlen)
{
if (oldval) {
size_t olen;
Expand Down Expand Up @@ -2583,7 +2580,7 @@ int sysctl_jiffies(ctl_table *table, int __user *name, int nlen,
/* Strategy function to convert jiffies to seconds */
int sysctl_ms_jiffies(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen, void **context)
void __user *newval, size_t newlen)
{
if (oldval) {
size_t olen;
Expand Down Expand Up @@ -2612,15 +2609,15 @@ int sysctl_ms_jiffies(ctl_table *table, int __user *name, int nlen,
/* The generic string strategy routine: */
static int sysctl_uts_string(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen, void **context)
void __user *newval, size_t newlen)
{
struct ctl_table uts_table;
int r, write;
write = newval && newlen;
memcpy(&uts_table, table, sizeof(uts_table));
uts_table.data = get_uts(table, write);
r = sysctl_string(&uts_table, name, nlen,
oldval, oldlenp, newval, newlen, context);
oldval, oldlenp, newval, newlen);
put_uts(table, write, uts_table.data);
return r;
}
Expand All @@ -2629,7 +2626,7 @@ static int sysctl_uts_string(ctl_table *table, int __user *name, int nlen,
/* The generic sysctl ipc data routine. */
static int sysctl_ipc_data(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen, void **context)
void __user *newval, size_t newlen)
{
size_t len;
void *data;
Expand Down Expand Up @@ -2704,41 +2701,41 @@ asmlinkage long sys_sysctl(struct __sysctl_args __user *args)

int sysctl_string(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen, void **context)
void __user *newval, size_t newlen)
{
return -ENOSYS;
}

int sysctl_intvec(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen, void **context)
void __user *newval, size_t newlen)
{
return -ENOSYS;
}

int sysctl_jiffies(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen, void **context)
void __user *newval, size_t newlen)
{
return -ENOSYS;
}

int sysctl_ms_jiffies(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen, void **context)
void __user *newval, size_t newlen)
{
return -ENOSYS;
}

static int sysctl_uts_string(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen, void **context)
void __user *newval, size_t newlen)
{
return -ENOSYS;
}
static int sysctl_ipc_data(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen, void **context)
void __user *newval, size_t newlen)
{
return -ENOSYS;
}
Expand Down
6 changes: 2 additions & 4 deletions net/decnet/dn_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,7 @@ static int dn_forwarding_proc(ctl_table *, int, struct file *,
void __user *, size_t *, loff_t *);
static int dn_forwarding_sysctl(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen,
void **context);
void __user *newval, size_t newlen);

static struct dn_dev_sysctl_table {
struct ctl_table_header *sysctl_header;
Expand Down Expand Up @@ -347,8 +346,7 @@ static int dn_forwarding_proc(ctl_table *table, int write,

static int dn_forwarding_sysctl(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen,
void **context)
void __user *newval, size_t newlen)
{
#ifdef CONFIG_DECNET_ROUTER
struct net_device *dev = table->extra1;
Expand Down
6 changes: 2 additions & 4 deletions net/decnet/sysctl_net_decnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ static int parse_addr(__le16 *addr, char *str)

static int dn_node_address_strategy(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen,
void **context)
void __user *newval, size_t newlen)
{
size_t len;
__le16 addr;
Expand Down Expand Up @@ -220,8 +219,7 @@ static int dn_node_address_handler(ctl_table *table, int write,

static int dn_def_dev_strategy(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen,
void **context)
void __user *newval, size_t newlen)
{
size_t len;
struct net_device *dev;
Expand Down
3 changes: 1 addition & 2 deletions net/ipv4/devinet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1303,8 +1303,7 @@ int ipv4_doint_and_flush(ctl_table *ctl, int write,

int ipv4_doint_and_flush_strategy(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen,
void **context)
void __user *newval, size_t newlen)
{
int *valp = table->data;
int new;
Expand Down
Loading

0 comments on commit 1f29bcd

Please sign in to comment.