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,
/* RED-PEN: seq_file can seek now. this is ignored. */
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:
"base=%Lx size=%Lx type=%s" OR:
"disable=%d"
......@@ -133,12 +133,13 @@ mtrr_write(struct file *file, const char *buf, size_t len, loff_t * ppos)
static int
mtrr_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
unsigned int cmd, unsigned long __arg)
{
int err;
mtrr_type type;
struct mtrr_sentry sentry;
struct mtrr_gentry gentry;
void __user *arg = (void __user *) __arg;
switch (cmd) {
default:
......@@ -146,7 +147,7 @@ mtrr_ioctl(struct inode *inode, struct file *file,
case MTRRIOC_ADD_ENTRY:
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
if (copy_from_user(&sentry, (void *) arg, sizeof sentry))
if (copy_from_user(&sentry, arg, sizeof sentry))
return -EFAULT;
err =
mtrr_file_add(sentry.base, sentry.size, sentry.type, 1,
......@@ -157,7 +158,7 @@ mtrr_ioctl(struct inode *inode, struct file *file,
case MTRRIOC_SET_ENTRY:
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
if (copy_from_user(&sentry, (void *) arg, sizeof sentry))
if (copy_from_user(&sentry, arg, sizeof sentry))
return -EFAULT;
err = mtrr_add(sentry.base, sentry.size, sentry.type, 0);
if (err < 0)
......@@ -166,7 +167,7 @@ mtrr_ioctl(struct inode *inode, struct file *file,
case MTRRIOC_DEL_ENTRY:
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
if (copy_from_user(&sentry, (void *) arg, sizeof sentry))
if (copy_from_user(&sentry, arg, sizeof sentry))
return -EFAULT;
err = mtrr_file_del(sentry.base, sentry.size, file, 0);
if (err < 0)
......@@ -175,14 +176,14 @@ mtrr_ioctl(struct inode *inode, struct file *file,
case MTRRIOC_KILL_ENTRY:
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
if (copy_from_user(&sentry, (void *) arg, sizeof sentry))
if (copy_from_user(&sentry, arg, sizeof sentry))
return -EFAULT;
err = mtrr_del(-1, sentry.base, sentry.size);
if (err < 0)
return err;
break;
case MTRRIOC_GET_ENTRY:
if (copy_from_user(&gentry, (void *) arg, sizeof gentry))
if (copy_from_user(&gentry, arg, sizeof gentry))
return -EFAULT;
if (gentry.regnum >= num_var_ranges)
return -EINVAL;
......@@ -198,13 +199,13 @@ mtrr_ioctl(struct inode *inode, struct file *file,
gentry.type = type;
}
if (copy_to_user((void *) arg, &gentry, sizeof gentry))
if (copy_to_user(arg, &gentry, sizeof gentry))
return -EFAULT;
break;
case MTRRIOC_ADD_PAGE_ENTRY:
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
if (copy_from_user(&sentry, (void *) arg, sizeof sentry))
if (copy_from_user(&sentry, arg, sizeof sentry))
return -EFAULT;
err =
mtrr_file_add(sentry.base, sentry.size, sentry.type, 1,
......@@ -215,7 +216,7 @@ mtrr_ioctl(struct inode *inode, struct file *file,
case MTRRIOC_SET_PAGE_ENTRY:
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
if (copy_from_user(&sentry, (void *) arg, sizeof sentry))
if (copy_from_user(&sentry, arg, sizeof sentry))
return -EFAULT;
err = mtrr_add_page(sentry.base, sentry.size, sentry.type, 0);
if (err < 0)
......@@ -224,7 +225,7 @@ mtrr_ioctl(struct inode *inode, struct file *file,
case MTRRIOC_DEL_PAGE_ENTRY:
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
if (copy_from_user(&sentry, (void *) arg, sizeof sentry))
if (copy_from_user(&sentry, arg, sizeof sentry))
return -EFAULT;
err = mtrr_file_del(sentry.base, sentry.size, file, 1);
if (err < 0)
......@@ -233,21 +234,21 @@ mtrr_ioctl(struct inode *inode, struct file *file,
case MTRRIOC_KILL_PAGE_ENTRY:
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
if (copy_from_user(&sentry, (void *) arg, sizeof sentry))
if (copy_from_user(&sentry, arg, sizeof sentry))
return -EFAULT;
err = mtrr_del_page(-1, sentry.base, sentry.size);
if (err < 0)
return err;
break;
case MTRRIOC_GET_PAGE_ENTRY:
if (copy_from_user(&gentry, (void *) arg, sizeof gentry))
if (copy_from_user(&gentry, arg, sizeof gentry))
return -EFAULT;
if (gentry.regnum >= num_var_ranges)
return -EINVAL;
mtrr_if->get(gentry.regnum, &gentry.base, &gentry.size, &type);
gentry.type = type;
if (copy_to_user((void *) arg, &gentry, sizeof gentry))
if (copy_to_user(arg, &gentry, sizeof gentry))
return -EFAULT;
break;
}
......
......@@ -280,7 +280,7 @@ asmlinkage long sys_utime(char __user * filename, struct utimbuf __user * times)
* must be owner or have write permission.
* 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;
struct nameidata nd;
......
......@@ -1017,7 +1017,7 @@ static inline int break_lease(struct inode *inode, unsigned int mode)
/* 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 */
extern int do_truncate(struct dentry *, loff_t start);
......
......@@ -204,7 +204,7 @@ extern void do_settimeofday(struct timeval *tv);
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 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
#define FD_SETSIZE __FD_SETSIZE
......
......@@ -792,7 +792,7 @@ unsigned int nr_free_pagecache_pages(void)
return nr_free_zone_pages(GFP_HIGHUSER & GFP_ZONEMASK);
}
#if CONFIG_HIGHMEM
#ifdef CONFIG_HIGHMEM
unsigned int nr_free_highpages (void)
{
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