aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-06-23 05:04:05 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-23 10:42:54 -0400
commit7ab76d722a0d64369080ec96f0fd9fca2138e3c5 (patch)
treec28b92f88c5d3e267f3c587c3b170518ae612be5 /arch
parent9e4d11f8630d5350adc5d4d65180e69991c498f8 (diff)
[PATCH] frv: sysctl __user annotations
Add __user annotations to FRV-specific sysctl stuff. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/frv/kernel/pm.c40
-rw-r--r--arch/frv/kernel/sysctl.c4
2 files changed, 22 insertions, 22 deletions
diff --git a/arch/frv/kernel/pm.c b/arch/frv/kernel/pm.c
index f0b8fff3e733..43ce28a13a5d 100644
--- a/arch/frv/kernel/pm.c
+++ b/arch/frv/kernel/pm.c
@@ -137,7 +137,7 @@ unsigned long sleep_phys_sp(void *sp)
137#define CTL_PM_P0 4 137#define CTL_PM_P0 4
138#define CTL_PM_CM 5 138#define CTL_PM_CM 5
139 139
140static int user_atoi(char *ubuf, size_t len) 140static int user_atoi(char __user *ubuf, size_t len)
141{ 141{
142 char buf[16]; 142 char buf[16];
143 unsigned long ret; 143 unsigned long ret;
@@ -159,7 +159,7 @@ static int user_atoi(char *ubuf, size_t len)
159 * Send us to sleep. 159 * Send us to sleep.
160 */ 160 */
161static int sysctl_pm_do_suspend(ctl_table *ctl, int write, struct file *filp, 161static int sysctl_pm_do_suspend(ctl_table *ctl, int write, struct file *filp,
162 void *buffer, size_t *lenp, loff_t *fpos) 162 void __user *buffer, size_t *lenp, loff_t *fpos)
163{ 163{
164 int retval, mode; 164 int retval, mode;
165 165
@@ -215,7 +215,7 @@ static int try_set_cmode(int new_cmode)
215 215
216 216
217static int cmode_procctl(ctl_table *ctl, int write, struct file *filp, 217static int cmode_procctl(ctl_table *ctl, int write, struct file *filp,
218 void *buffer, size_t *lenp, loff_t *fpos) 218 void __user *buffer, size_t *lenp, loff_t *fpos)
219{ 219{
220 int new_cmode; 220 int new_cmode;
221 221
@@ -227,9 +227,9 @@ static int cmode_procctl(ctl_table *ctl, int write, struct file *filp,
227 return try_set_cmode(new_cmode)?:*lenp; 227 return try_set_cmode(new_cmode)?:*lenp;
228} 228}
229 229
230static int cmode_sysctl(ctl_table *table, int *name, int nlen, 230static int cmode_sysctl(ctl_table *table, int __user *name, int nlen,
231 void *oldval, size_t *oldlenp, 231 void __user *oldval, size_t __user *oldlenp,
232 void *newval, size_t newlen, void **context) 232 void __user *newval, size_t newlen, void **context)
233{ 233{
234 if (oldval && oldlenp) { 234 if (oldval && oldlenp) {
235 size_t oldlen; 235 size_t oldlen;
@@ -240,7 +240,7 @@ static int cmode_sysctl(ctl_table *table, int *name, int nlen,
240 if (oldlen != sizeof(int)) 240 if (oldlen != sizeof(int))
241 return -EINVAL; 241 return -EINVAL;
242 242
243 if (put_user(clock_cmode_current, (unsigned int *)oldval) || 243 if (put_user(clock_cmode_current, (unsigned __user *)oldval) ||
244 put_user(sizeof(int), oldlenp)) 244 put_user(sizeof(int), oldlenp))
245 return -EFAULT; 245 return -EFAULT;
246 } 246 }
@@ -250,7 +250,7 @@ static int cmode_sysctl(ctl_table *table, int *name, int nlen,
250 if (newlen != sizeof(int)) 250 if (newlen != sizeof(int))
251 return -EINVAL; 251 return -EINVAL;
252 252
253 if (get_user(new_cmode, (int *)newval)) 253 if (get_user(new_cmode, (int __user *)newval))
254 return -EFAULT; 254 return -EFAULT;
255 255
256 return try_set_cmode(new_cmode)?:1; 256 return try_set_cmode(new_cmode)?:1;
@@ -318,7 +318,7 @@ static int try_set_cm(int new_cm)
318} 318}
319 319
320static int p0_procctl(ctl_table *ctl, int write, struct file *filp, 320static int p0_procctl(ctl_table *ctl, int write, struct file *filp,
321 void *buffer, size_t *lenp, loff_t *fpos) 321 void __user *buffer, size_t *lenp, loff_t *fpos)
322{ 322{
323 int new_p0; 323 int new_p0;
324 324
@@ -330,9 +330,9 @@ static int p0_procctl(ctl_table *ctl, int write, struct file *filp,
330 return try_set_p0(new_p0)?:*lenp; 330 return try_set_p0(new_p0)?:*lenp;
331} 331}
332 332
333static int p0_sysctl(ctl_table *table, int *name, int nlen, 333static int p0_sysctl(ctl_table *table, int __user *name, int nlen,
334 void *oldval, size_t *oldlenp, 334 void __user *oldval, size_t __user *oldlenp,
335 void *newval, size_t newlen, void **context) 335 void __user *newval, size_t newlen, void **context)
336{ 336{
337 if (oldval && oldlenp) { 337 if (oldval && oldlenp) {
338 size_t oldlen; 338 size_t oldlen;
@@ -343,7 +343,7 @@ static int p0_sysctl(ctl_table *table, int *name, int nlen,
343 if (oldlen != sizeof(int)) 343 if (oldlen != sizeof(int))
344 return -EINVAL; 344 return -EINVAL;
345 345
346 if (put_user(clock_p0_current, (unsigned int *)oldval) || 346 if (put_user(clock_p0_current, (unsigned __user *)oldval) ||
347 put_user(sizeof(int), oldlenp)) 347 put_user(sizeof(int), oldlenp))
348 return -EFAULT; 348 return -EFAULT;
349 } 349 }
@@ -353,7 +353,7 @@ static int p0_sysctl(ctl_table *table, int *name, int nlen,
353 if (newlen != sizeof(int)) 353 if (newlen != sizeof(int))
354 return -EINVAL; 354 return -EINVAL;
355 355
356 if (get_user(new_p0, (int *)newval)) 356 if (get_user(new_p0, (int __user *)newval))
357 return -EFAULT; 357 return -EFAULT;
358 358
359 return try_set_p0(new_p0)?:1; 359 return try_set_p0(new_p0)?:1;
@@ -362,7 +362,7 @@ static int p0_sysctl(ctl_table *table, int *name, int nlen,
362} 362}
363 363
364static int cm_procctl(ctl_table *ctl, int write, struct file *filp, 364static int cm_procctl(ctl_table *ctl, int write, struct file *filp,
365 void *buffer, size_t *lenp, loff_t *fpos) 365 void __user *buffer, size_t *lenp, loff_t *fpos)
366{ 366{
367 int new_cm; 367 int new_cm;
368 368
@@ -374,9 +374,9 @@ static int cm_procctl(ctl_table *ctl, int write, struct file *filp,
374 return try_set_cm(new_cm)?:*lenp; 374 return try_set_cm(new_cm)?:*lenp;
375} 375}
376 376
377static int cm_sysctl(ctl_table *table, int *name, int nlen, 377static int cm_sysctl(ctl_table *table, int __user *name, int nlen,
378 void *oldval, size_t *oldlenp, 378 void __user *oldval, size_t __user *oldlenp,
379 void *newval, size_t newlen, void **context) 379 void __user *newval, size_t newlen, void **context)
380{ 380{
381 if (oldval && oldlenp) { 381 if (oldval && oldlenp) {
382 size_t oldlen; 382 size_t oldlen;
@@ -387,7 +387,7 @@ static int cm_sysctl(ctl_table *table, int *name, int nlen,
387 if (oldlen != sizeof(int)) 387 if (oldlen != sizeof(int))
388 return -EINVAL; 388 return -EINVAL;
389 389
390 if (put_user(clock_cm_current, (unsigned int *)oldval) || 390 if (put_user(clock_cm_current, (unsigned __user *)oldval) ||
391 put_user(sizeof(int), oldlenp)) 391 put_user(sizeof(int), oldlenp))
392 return -EFAULT; 392 return -EFAULT;
393 } 393 }
@@ -397,7 +397,7 @@ static int cm_sysctl(ctl_table *table, int *name, int nlen,
397 if (newlen != sizeof(int)) 397 if (newlen != sizeof(int))
398 return -EINVAL; 398 return -EINVAL;
399 399
400 if (get_user(new_cm, (int *)newval)) 400 if (get_user(new_cm, (int __user *)newval))
401 return -EFAULT; 401 return -EFAULT;
402 402
403 return try_set_cm(new_cm)?:1; 403 return try_set_cm(new_cm)?:1;
diff --git a/arch/frv/kernel/sysctl.c b/arch/frv/kernel/sysctl.c
index 408b0f382b42..b908863d6593 100644
--- a/arch/frv/kernel/sysctl.c
+++ b/arch/frv/kernel/sysctl.c
@@ -49,7 +49,7 @@ static void frv_change_dcache_mode(unsigned long newmode)
49 * handle requests to dynamically switch the write caching mode delivered by /proc 49 * handle requests to dynamically switch the write caching mode delivered by /proc
50 */ 50 */
51static int procctl_frv_cachemode(ctl_table *table, int write, struct file *filp, 51static int procctl_frv_cachemode(ctl_table *table, int write, struct file *filp,
52 void *buffer, size_t *lenp, loff_t *ppos) 52 void __user *buffer, size_t *lenp, loff_t *ppos)
53{ 53{
54 unsigned long hsr0; 54 unsigned long hsr0;
55 char buff[8]; 55 char buff[8];
@@ -123,7 +123,7 @@ static int procctl_frv_cachemode(ctl_table *table, int write, struct file *filp,
123 */ 123 */
124#ifdef CONFIG_MMU 124#ifdef CONFIG_MMU
125static int procctl_frv_pin_cxnr(ctl_table *table, int write, struct file *filp, 125static int procctl_frv_pin_cxnr(ctl_table *table, int write, struct file *filp,
126 void *buffer, size_t *lenp, loff_t *ppos) 126 void __user *buffer, size_t *lenp, loff_t *ppos)
127{ 127{
128 pid_t pid; 128 pid_t pid;
129 char buff[16], *p; 129 char buff[16], *p;