patch-2.4.27 linux-2.4.27/drivers/usb/drivers.c
Next file: linux-2.4.27/drivers/usb/gadget/Config.in
Previous file: linux-2.4.27/drivers/usb/devio.c
Back to the patch index
Back to the overall index
- Lines: 30
- Date:
2004-08-07 16:26:05.683389059 -0700
- Orig file:
linux-2.4.26/drivers/usb/drivers.c
- Orig date:
2000-04-26 15:22:55.000000000 -0700
diff -urN linux-2.4.26/drivers/usb/drivers.c linux-2.4.27/drivers/usb/drivers.c
@@ -52,9 +52,10 @@
struct list_head *tmp = usb_driver_list.next;
char *page, *start, *end;
ssize_t ret = 0;
- unsigned int pos, len;
+ loff_t n = *ppos;
+ unsigned int pos = n, len;
- if (*ppos < 0)
+ if (pos != n)
return -EINVAL;
if (nbytes <= 0)
return 0;
@@ -64,7 +65,6 @@
return -ENOMEM;
start = page;
end = page + (PAGE_SIZE - 100);
- pos = *ppos;
for (; tmp != &usb_driver_list; tmp = tmp->next) {
struct usb_driver *driver = list_entry(tmp, struct usb_driver, driver_list);
int minor = driver->fops ? driver->minor : -1;
@@ -88,7 +88,7 @@
if (copy_to_user(buf, page + pos, len))
ret = -EFAULT;
else
- *ppos += len;
+ *ppos = pos + len;
}
free_page((unsigned long)page);
return ret;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)