Commit 037ed253 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://kernel.bkbits.net/davem/net-2.5

into home.transmeta.com:/home/torvalds/v2.5/linux
parents f5bda5bc 9630291c
...@@ -70,7 +70,7 @@ mtrr_file_del(unsigned long base, unsigned long size, ...@@ -70,7 +70,7 @@ mtrr_file_del(unsigned long base, unsigned long size,
/* RED-PEN: seq_file can seek now. this is ignored. */ /* RED-PEN: seq_file can seek now. this is ignored. */
static ssize_t static ssize_t
mtrr_write(struct file *file, const char *buf, size_t len, loff_t * ppos) mtrr_write(struct file *file, const char __user *buf, size_t len, loff_t * ppos)
/* Format of control line: /* Format of control line:
"base=%Lx size=%Lx type=%s" OR: "base=%Lx size=%Lx type=%s" OR:
"disable=%d" "disable=%d"
...@@ -133,12 +133,13 @@ mtrr_write(struct file *file, const char *buf, size_t len, loff_t * ppos) ...@@ -133,12 +133,13 @@ mtrr_write(struct file *file, const char *buf, size_t len, loff_t * ppos)
static int static int
mtrr_ioctl(struct inode *inode, struct file *file, mtrr_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long __arg)
{ {
int err; int err;
mtrr_type type; mtrr_type type;
struct mtrr_sentry sentry; struct mtrr_sentry sentry;
struct mtrr_gentry gentry; struct mtrr_gentry gentry;
void __user *arg = (void __user *) __arg;
switch (cmd) { switch (cmd) {
default: default:
...@@ -146,7 +147,7 @@ mtrr_ioctl(struct inode *inode, struct file *file, ...@@ -146,7 +147,7 @@ mtrr_ioctl(struct inode *inode, struct file *file,
case MTRRIOC_ADD_ENTRY: case MTRRIOC_ADD_ENTRY:
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
if (copy_from_user(&sentry, (void *) arg, sizeof sentry)) if (copy_from_user(&sentry, arg, sizeof sentry))
return -EFAULT; return -EFAULT;
err = err =
mtrr_file_add(sentry.base, sentry.size, sentry.type, 1, mtrr_file_add(sentry.base, sentry.size, sentry.type, 1,
...@@ -157,7 +158,7 @@ mtrr_ioctl(struct inode *inode, struct file *file, ...@@ -157,7 +158,7 @@ mtrr_ioctl(struct inode *inode, struct file *file,
case MTRRIOC_SET_ENTRY: case MTRRIOC_SET_ENTRY:
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
if (copy_from_user(&sentry, (void *) arg, sizeof sentry)) if (copy_from_user(&sentry, arg, sizeof sentry))
return -EFAULT; return -EFAULT;
err = mtrr_add(sentry.base, sentry.size, sentry.type, 0); err = mtrr_add(sentry.base, sentry.size, sentry.type, 0);
if (err < 0) if (err < 0)
...@@ -166,7 +167,7 @@ mtrr_ioctl(struct inode *inode, struct file *file, ...@@ -166,7 +167,7 @@ mtrr_ioctl(struct inode *inode, struct file *file,
case MTRRIOC_DEL_ENTRY: case MTRRIOC_DEL_ENTRY:
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
if (copy_from_user(&sentry, (void *) arg, sizeof sentry)) if (copy_from_user(&sentry, arg, sizeof sentry))
return -EFAULT; return -EFAULT;
err = mtrr_file_del(sentry.base, sentry.size, file, 0); err = mtrr_file_del(sentry.base, sentry.size, file, 0);
if (err < 0) if (err < 0)
...@@ -175,14 +176,14 @@ mtrr_ioctl(struct inode *inode, struct file *file, ...@@ -175,14 +176,14 @@ mtrr_ioctl(struct inode *inode, struct file *file,
case MTRRIOC_KILL_ENTRY: case MTRRIOC_KILL_ENTRY:
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
if (copy_from_user(&sentry, (void *) arg, sizeof sentry)) if (copy_from_user(&sentry, arg, sizeof sentry))
return -EFAULT; return -EFAULT;
err = mtrr_del(-1, sentry.base, sentry.size); err = mtrr_del(-1, sentry.base, sentry.size);
if (err < 0) if (err < 0)
return err; return err;
break; break;
case MTRRIOC_GET_ENTRY: case MTRRIOC_GET_ENTRY:
if (copy_from_user(&gentry, (void *) arg, sizeof gentry)) if (copy_from_user(&gentry, arg, sizeof gentry))
return -EFAULT; return -EFAULT;
if (gentry.regnum >= num_var_ranges) if (gentry.regnum >= num_var_ranges)
return -EINVAL; return -EINVAL;
...@@ -198,13 +199,13 @@ mtrr_ioctl(struct inode *inode, struct file *file, ...@@ -198,13 +199,13 @@ mtrr_ioctl(struct inode *inode, struct file *file,
gentry.type = type; gentry.type = type;
} }
if (copy_to_user((void *) arg, &gentry, sizeof gentry)) if (copy_to_user(arg, &gentry, sizeof gentry))
return -EFAULT; return -EFAULT;
break; break;
case MTRRIOC_ADD_PAGE_ENTRY: case MTRRIOC_ADD_PAGE_ENTRY:
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
if (copy_from_user(&sentry, (void *) arg, sizeof sentry)) if (copy_from_user(&sentry, arg, sizeof sentry))
return -EFAULT; return -EFAULT;
err = err =
mtrr_file_add(sentry.base, sentry.size, sentry.type, 1, mtrr_file_add(sentry.base, sentry.size, sentry.type, 1,
...@@ -215,7 +216,7 @@ mtrr_ioctl(struct inode *inode, struct file *file, ...@@ -215,7 +216,7 @@ mtrr_ioctl(struct inode *inode, struct file *file,
case MTRRIOC_SET_PAGE_ENTRY: case MTRRIOC_SET_PAGE_ENTRY:
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
if (copy_from_user(&sentry, (void *) arg, sizeof sentry)) if (copy_from_user(&sentry, arg, sizeof sentry))
return -EFAULT; return -EFAULT;
err = mtrr_add_page(sentry.base, sentry.size, sentry.type, 0); err = mtrr_add_page(sentry.base, sentry.size, sentry.type, 0);
if (err < 0) if (err < 0)
...@@ -224,7 +225,7 @@ mtrr_ioctl(struct inode *inode, struct file *file, ...@@ -224,7 +225,7 @@ mtrr_ioctl(struct inode *inode, struct file *file,
case MTRRIOC_DEL_PAGE_ENTRY: case MTRRIOC_DEL_PAGE_ENTRY:
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
if (copy_from_user(&sentry, (void *) arg, sizeof sentry)) if (copy_from_user(&sentry, arg, sizeof sentry))
return -EFAULT; return -EFAULT;
err = mtrr_file_del(sentry.base, sentry.size, file, 1); err = mtrr_file_del(sentry.base, sentry.size, file, 1);
if (err < 0) if (err < 0)
...@@ -233,21 +234,21 @@ mtrr_ioctl(struct inode *inode, struct file *file, ...@@ -233,21 +234,21 @@ mtrr_ioctl(struct inode *inode, struct file *file,
case MTRRIOC_KILL_PAGE_ENTRY: case MTRRIOC_KILL_PAGE_ENTRY:
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
if (copy_from_user(&sentry, (void *) arg, sizeof sentry)) if (copy_from_user(&sentry, arg, sizeof sentry))
return -EFAULT; return -EFAULT;
err = mtrr_del_page(-1, sentry.base, sentry.size); err = mtrr_del_page(-1, sentry.base, sentry.size);
if (err < 0) if (err < 0)
return err; return err;
break; break;
case MTRRIOC_GET_PAGE_ENTRY: case MTRRIOC_GET_PAGE_ENTRY:
if (copy_from_user(&gentry, (void *) arg, sizeof gentry)) if (copy_from_user(&gentry, arg, sizeof gentry))
return -EFAULT; return -EFAULT;
if (gentry.regnum >= num_var_ranges) if (gentry.regnum >= num_var_ranges)
return -EINVAL; return -EINVAL;
mtrr_if->get(gentry.regnum, &gentry.base, &gentry.size, &type); mtrr_if->get(gentry.regnum, &gentry.base, &gentry.size, &type);
gentry.type = type; gentry.type = type;
if (copy_to_user((void *) arg, &gentry, sizeof gentry)) if (copy_to_user(arg, &gentry, sizeof gentry))
return -EFAULT; return -EFAULT;
break; break;
} }
......
...@@ -280,7 +280,7 @@ asmlinkage long sys_utime(char __user * filename, struct utimbuf __user * times) ...@@ -280,7 +280,7 @@ asmlinkage long sys_utime(char __user * filename, struct utimbuf __user * times)
* must be owner or have write permission. * must be owner or have write permission.
* Else, update from *times, must be owner or super user. * Else, update from *times, must be owner or super user.
*/ */
long do_utimes(char __user * filename, struct timeval __user * times) long do_utimes(char __user * filename, struct timeval * times)
{ {
int error; int error;
struct nameidata nd; struct nameidata nd;
......
...@@ -1017,7 +1017,7 @@ static inline int break_lease(struct inode *inode, unsigned int mode) ...@@ -1017,7 +1017,7 @@ static inline int break_lease(struct inode *inode, unsigned int mode)
/* fs/open.c */ /* fs/open.c */
asmlinkage long sys_open(const char *, int, int); asmlinkage long sys_open(const char __user *, int, int);
asmlinkage long sys_close(unsigned int); /* yes, it's really unsigned */ asmlinkage long sys_close(unsigned int); /* yes, it's really unsigned */
extern int do_truncate(struct dentry *, loff_t start); extern int do_truncate(struct dentry *, loff_t start);
......
...@@ -204,7 +204,7 @@ extern void do_settimeofday(struct timeval *tv); ...@@ -204,7 +204,7 @@ extern void do_settimeofday(struct timeval *tv);
extern int do_sys_settimeofday(struct timeval *tv, struct timezone *tz); extern int do_sys_settimeofday(struct timeval *tv, struct timezone *tz);
extern void clock_was_set(void); // call when ever the clock is set extern void clock_was_set(void); // call when ever the clock is set
extern long do_nanosleep(struct timespec *t); extern long do_nanosleep(struct timespec *t);
extern long do_utimes(char * filename, struct timeval * times); extern long do_utimes(char __user * filename, struct timeval * times);
#endif #endif
#define FD_SETSIZE __FD_SETSIZE #define FD_SETSIZE __FD_SETSIZE
......
...@@ -792,7 +792,7 @@ unsigned int nr_free_pagecache_pages(void) ...@@ -792,7 +792,7 @@ unsigned int nr_free_pagecache_pages(void)
return nr_free_zone_pages(GFP_HIGHUSER & GFP_ZONEMASK); return nr_free_zone_pages(GFP_HIGHUSER & GFP_ZONEMASK);
} }
#if CONFIG_HIGHMEM #ifdef CONFIG_HIGHMEM
unsigned int nr_free_highpages (void) unsigned int nr_free_highpages (void)
{ {
pg_data_t *pgdat; pg_data_t *pgdat;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment