static int uhci_show_status(struct uhci_hcd *uhci, char *buf, int len)
{
char *out = buf;
- unsigned int io_addr = uhci->io_addr;
+ unsigned long io_addr = uhci->io_addr;
unsigned short usbcmd, usbstat, usbint, usbfrnum;
unsigned int flbaseadd;
unsigned char sof;
return (file->f_pos = new);
}
-static ssize_t uhci_proc_read(struct file *file, char *buf, size_t nbytes,
- loff_t *ppos)
+static ssize_t uhci_proc_read(struct file *file, char __user *buf,
+ size_t nbytes, loff_t *ppos)
{
struct uhci_proc *up = file->private_data;
unsigned int pos;
size = up->size;
if (pos >= size)
return 0;
- if (nbytes >= size)
- nbytes = size;
- if (pos + nbytes > size)
+ if (nbytes > size - pos)
nbytes = size - pos;
- if (!access_ok(VERIFY_WRITE, buf, nbytes))
- return -EINVAL;
-
if (copy_to_user(buf, up->data + pos, nbytes))
return -EFAULT;