Commit 2a1775fd authored by Paul Mackerras's avatar Paul Mackerras Committed by Linus Torvalds

[PATCH] fix check warnings in drivers/macintosh

This patch removes the warnings that the `check' program came up with
in drivers/macintosh.  This involves adding __user in various places
and fixing some non-ANSI function definitions for functions that take
no arguments.
parent ea8582b1
......@@ -749,7 +749,7 @@ static int adb_release(struct inode *inode, struct file *file)
return 0;
}
static ssize_t adb_read(struct file *file, char *buf,
static ssize_t adb_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
int ret;
......@@ -810,7 +810,7 @@ static ssize_t adb_read(struct file *file, char *buf,
return ret;
}
static ssize_t adb_write(struct file *file, const char *buf,
static ssize_t adb_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
int ret/*, i*/;
......
......@@ -180,7 +180,7 @@ static int check_apm_user(struct apm_user *as, const char *func)
return 0;
}
static ssize_t do_read(struct file *fp, char *buf, size_t count, loff_t *ppos)
static ssize_t do_read(struct file *fp, char __user *buf, size_t count, loff_t *ppos)
{
struct apm_user * as;
size_t i;
......
......@@ -1694,7 +1694,7 @@ static void rs_unthrottle(struct tty_struct * tty)
*/
static int get_serial_info(struct mac_serial * info,
struct serial_struct * retinfo)
struct serial_struct __user * retinfo)
{
struct serial_struct tmp;
......@@ -1716,7 +1716,7 @@ static int get_serial_info(struct mac_serial * info,
}
static int set_serial_info(struct mac_serial * info,
struct serial_struct * new_info)
struct serial_struct __user * new_info)
{
struct serial_struct new_serial;
struct mac_serial old_info;
......@@ -1876,15 +1876,15 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
return set_modem_info(info, cmd, (unsigned int *) arg);
case TIOCGSERIAL:
return get_serial_info(info,
(struct serial_struct *) arg);
(struct serial_struct __user *) arg);
case TIOCSSERIAL:
return set_serial_info(info,
(struct serial_struct *) arg);
(struct serial_struct __user *) arg);
case TIOCSERGETLSR: /* Get line status register */
return get_lsr_info(info, (unsigned int *) arg);
case TIOCSERGSTRUCT:
if (copy_to_user((struct mac_serial *) arg,
if (copy_to_user((struct mac_serial __user *) arg,
info, sizeof(struct mac_serial)))
return -EFAULT;
return 0;
......@@ -2432,7 +2432,7 @@ int macserial_read_proc(char *page, char **start, off_t off, int count,
/* Ask the PROM how many Z8530s we have and initialize their zs_channels */
static void
probe_sccs()
probe_sccs(void)
{
struct device_node *dev, *ch;
struct mac_serial **pp;
......
......@@ -39,11 +39,11 @@ static loff_t nvram_llseek(struct file *file, loff_t offset, int origin)
return file->f_pos;
}
static ssize_t read_nvram(struct file *file, char *buf,
static ssize_t read_nvram(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
unsigned int i;
char *p = buf;
char __user *p = buf;
if (verify_area(VERIFY_WRITE, buf, count))
return -EFAULT;
......@@ -56,11 +56,11 @@ static ssize_t read_nvram(struct file *file, char *buf,
return p - buf;
}
static ssize_t write_nvram(struct file *file, const char *buf,
static ssize_t write_nvram(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
unsigned int i;
const char *p = buf;
const char __user *p = buf;
char c;
if (verify_area(VERIFY_READ, buf, count))
......@@ -83,12 +83,12 @@ static int nvram_ioctl(struct inode *inode, struct file *file,
case PMAC_NVRAM_GET_OFFSET:
{
int part, offset;
if (copy_from_user(&part,(void*)arg,sizeof(part))!=0)
if (copy_from_user(&part, (void __user*)arg, sizeof(part)) != 0)
return -EFAULT;
if (part < pmac_nvram_OF || part > pmac_nvram_NR)
return -EINVAL;
offset = pmac_get_partition(part);
if (copy_to_user((void*)arg,&offset,sizeof(offset))!=0)
if (copy_to_user((void __user*)arg, &offset, sizeof(offset)) != 0)
return -EFAULT;
break;
}
......
......@@ -213,7 +213,7 @@ device_initcall(via_cuda_start);
#ifdef CONFIG_ADB
static int
cuda_probe()
cuda_probe(void)
{
#ifdef CONFIG_PPC
if (sys_ctrler != SYS_CTRLER_CUDA)
......@@ -258,7 +258,7 @@ cuda_init(void)
} while (0)
static int
cuda_init_via()
cuda_init_via(void)
{
out_8(&via[DIRB], (in_8(&via[DIRB]) | TACK | TIP) & ~TREQ); /* TACK & TIP out */
out_8(&via[B], in_8(&via[B]) | TACK | TIP); /* negate them */
......@@ -407,7 +407,7 @@ cuda_write(struct adb_request *req)
}
static void
cuda_start()
cuda_start(void)
{
struct adb_request *req;
......@@ -427,7 +427,7 @@ cuda_start()
}
void
cuda_poll()
cuda_poll(void)
{
unsigned long flags;
......
......@@ -195,7 +195,7 @@ static int proc_get_batt(char *page, char **start, off_t off,
#endif /* CONFIG_PMAC_PBOOK */
static int proc_read_options(char *page, char **start, off_t off,
int count, int *eof, void *data);
static int proc_write_options(struct file *file, const char *buffer,
static int proc_write_options(struct file *file, const char __user *buffer,
unsigned long count, void *data);
#ifdef CONFIG_ADB
......@@ -290,7 +290,7 @@ static struct backlight_controller pmu_backlight_controller = {
#endif /* CONFIG_PMAC_BACKLIGHT */
int __openfirmware
find_via_pmu()
find_via_pmu(void)
{
if (via != 0)
return 1;
......@@ -371,7 +371,7 @@ find_via_pmu()
#ifdef CONFIG_ADB
static int __openfirmware
pmu_probe()
pmu_probe(void)
{
return vias == NULL? -ENODEV: 0;
}
......@@ -510,7 +510,7 @@ static int __init via_pmu_dev_init(void)
device_initcall(via_pmu_dev_init);
static int __openfirmware
init_pmu()
init_pmu(void)
{
int timeout;
struct adb_request req;
......@@ -815,7 +815,7 @@ proc_read_options(char *page, char **start, off_t off,
}
static int __pmac
proc_write_options(struct file *file, const char *buffer,
proc_write_options(struct file *file, const char __user *buffer,
unsigned long count, void *data)
{
char tmp[33];
......@@ -1112,7 +1112,7 @@ pmu_done(struct adb_request *req)
}
static void __pmac
pmu_start()
pmu_start(void)
{
struct adb_request *req;
......@@ -1136,7 +1136,7 @@ pmu_start()
}
void __openfirmware
pmu_poll()
pmu_poll(void)
{
if (!via)
return;
......@@ -2402,7 +2402,7 @@ pmu_open(struct inode *inode, struct file *file)
}
static ssize_t __pmac
pmu_read(struct file *file, char *buf,
pmu_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
struct pmu_private *pp = file->private_data;
......@@ -2455,7 +2455,7 @@ pmu_read(struct file *file, char *buf,
}
static ssize_t __pmac
pmu_write(struct file *file, const char *buf,
pmu_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
return 0;
......
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