diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2006-09-13 15:38:41 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-09-27 14:58:59 -0400 |
commit | ec17cf1cfe0b557210b27313bd584e9b5187d4ca (patch) | |
tree | 002f63361c189d3ce3820284199e6fe5d3d95eec /drivers/usb | |
parent | d774efeabccf5f5207aa70d5c126fc928e8b30bd (diff) |
USB: Remove unneeded void * casts in core files
The patch removes unneeded casts for the following (void *) pointers:
- struct file: private
- struct urb: context
- struct usb_bus: hcpriv
- return value of kmalloc()
The patch also contains some whitespace cleanup in the relevant areas.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/core/devices.c | 4 | ||||
-rw-r--r-- | drivers/usb/core/devio.c | 12 | ||||
-rw-r--r-- | drivers/usb/core/hub.c | 4 | ||||
-rw-r--r-- | drivers/usb/core/message.c | 2 | ||||
-rw-r--r-- | drivers/usb/core/urb.c | 2 |
5 files changed, 12 insertions, 12 deletions
diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c index 241d37326ea9..3538c2fdadfe 100644 --- a/drivers/usb/core/devices.c +++ b/drivers/usb/core/devices.c | |||
@@ -593,7 +593,7 @@ static ssize_t usb_device_read(struct file *file, char __user *buf, size_t nbyte | |||
593 | /* Kernel lock for "lastev" protection */ | 593 | /* Kernel lock for "lastev" protection */ |
594 | static unsigned int usb_device_poll(struct file *file, struct poll_table_struct *wait) | 594 | static unsigned int usb_device_poll(struct file *file, struct poll_table_struct *wait) |
595 | { | 595 | { |
596 | struct usb_device_status *st = (struct usb_device_status *)file->private_data; | 596 | struct usb_device_status *st = file->private_data; |
597 | unsigned int mask = 0; | 597 | unsigned int mask = 0; |
598 | 598 | ||
599 | lock_kernel(); | 599 | lock_kernel(); |
@@ -603,7 +603,7 @@ static unsigned int usb_device_poll(struct file *file, struct poll_table_struct | |||
603 | unlock_kernel(); | 603 | unlock_kernel(); |
604 | return POLLIN; | 604 | return POLLIN; |
605 | } | 605 | } |
606 | 606 | ||
607 | /* we may have dropped BKL - need to check for having lost the race */ | 607 | /* we may have dropped BKL - need to check for having lost the race */ |
608 | if (file->private_data) { | 608 | if (file->private_data) { |
609 | kfree(st); | 609 | kfree(st); |
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 71bbd25a4ed0..a94c63bef632 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c | |||
@@ -122,7 +122,7 @@ static loff_t usbdev_lseek(struct file *file, loff_t offset, int orig) | |||
122 | 122 | ||
123 | static ssize_t usbdev_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) | 123 | static ssize_t usbdev_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) |
124 | { | 124 | { |
125 | struct dev_state *ps = (struct dev_state *)file->private_data; | 125 | struct dev_state *ps = file->private_data; |
126 | struct usb_device *dev = ps->dev; | 126 | struct usb_device *dev = ps->dev; |
127 | ssize_t ret = 0; | 127 | ssize_t ret = 0; |
128 | unsigned len; | 128 | unsigned len; |
@@ -305,7 +305,7 @@ static void snoop_urb(struct urb *urb, void __user *userurb) | |||
305 | 305 | ||
306 | static void async_completed(struct urb *urb, struct pt_regs *regs) | 306 | static void async_completed(struct urb *urb, struct pt_regs *regs) |
307 | { | 307 | { |
308 | struct async *as = (struct async *)urb->context; | 308 | struct async *as = urb->context; |
309 | struct dev_state *ps = as->ps; | 309 | struct dev_state *ps = as->ps; |
310 | struct siginfo sinfo; | 310 | struct siginfo sinfo; |
311 | 311 | ||
@@ -591,7 +591,7 @@ static int usbdev_open(struct inode *inode, struct file *file) | |||
591 | 591 | ||
592 | static int usbdev_release(struct inode *inode, struct file *file) | 592 | static int usbdev_release(struct inode *inode, struct file *file) |
593 | { | 593 | { |
594 | struct dev_state *ps = (struct dev_state *)file->private_data; | 594 | struct dev_state *ps = file->private_data; |
595 | struct usb_device *dev = ps->dev; | 595 | struct usb_device *dev = ps->dev; |
596 | unsigned int ifnum; | 596 | unsigned int ifnum; |
597 | 597 | ||
@@ -1423,7 +1423,7 @@ static int proc_ioctl_compat(struct dev_state *ps, compat_uptr_t arg) | |||
1423 | */ | 1423 | */ |
1424 | static int usbdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) | 1424 | static int usbdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) |
1425 | { | 1425 | { |
1426 | struct dev_state *ps = (struct dev_state *)file->private_data; | 1426 | struct dev_state *ps = file->private_data; |
1427 | struct usb_device *dev = ps->dev; | 1427 | struct usb_device *dev = ps->dev; |
1428 | void __user *p = (void __user *)arg; | 1428 | void __user *p = (void __user *)arg; |
1429 | int ret = -ENOTTY; | 1429 | int ret = -ENOTTY; |
@@ -1566,8 +1566,8 @@ static int usbdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd | |||
1566 | /* No kernel lock - fine */ | 1566 | /* No kernel lock - fine */ |
1567 | static unsigned int usbdev_poll(struct file *file, struct poll_table_struct *wait) | 1567 | static unsigned int usbdev_poll(struct file *file, struct poll_table_struct *wait) |
1568 | { | 1568 | { |
1569 | struct dev_state *ps = (struct dev_state *)file->private_data; | 1569 | struct dev_state *ps = file->private_data; |
1570 | unsigned int mask = 0; | 1570 | unsigned int mask = 0; |
1571 | 1571 | ||
1572 | poll_wait(file, &ps->wait, wait); | 1572 | poll_wait(file, &ps->wait, wait); |
1573 | if (file->f_mode & FMODE_WRITE && !list_empty(&ps->async_completed)) | 1573 | if (file->f_mode & FMODE_WRITE && !list_empty(&ps->async_completed)) |
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 7479bd329abb..c74baad19b16 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -293,7 +293,7 @@ void usb_kick_khubd(struct usb_device *hdev) | |||
293 | /* completion function, fires on port status changes and various faults */ | 293 | /* completion function, fires on port status changes and various faults */ |
294 | static void hub_irq(struct urb *urb, struct pt_regs *regs) | 294 | static void hub_irq(struct urb *urb, struct pt_regs *regs) |
295 | { | 295 | { |
296 | struct usb_hub *hub = (struct usb_hub *)urb->context; | 296 | struct usb_hub *hub = urb->context; |
297 | int status; | 297 | int status; |
298 | int i; | 298 | int i; |
299 | unsigned long bits; | 299 | unsigned long bits; |
@@ -311,7 +311,7 @@ static void hub_irq(struct urb *urb, struct pt_regs *regs) | |||
311 | goto resubmit; | 311 | goto resubmit; |
312 | hub->error = urb->status; | 312 | hub->error = urb->status; |
313 | /* FALL THROUGH */ | 313 | /* FALL THROUGH */ |
314 | 314 | ||
315 | /* let khubd handle things */ | 315 | /* let khubd handle things */ |
316 | case 0: /* we got data: port status changed */ | 316 | case 0: /* we got data: port status changed */ |
317 | bits = 0; | 317 | bits = 0; |
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index 28c6cf225780..85b1cd18336f 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c | |||
@@ -248,7 +248,7 @@ static void sg_clean (struct usb_sg_request *io) | |||
248 | 248 | ||
249 | static void sg_complete (struct urb *urb, struct pt_regs *regs) | 249 | static void sg_complete (struct urb *urb, struct pt_regs *regs) |
250 | { | 250 | { |
251 | struct usb_sg_request *io = (struct usb_sg_request *) urb->context; | 251 | struct usb_sg_request *io = urb->context; |
252 | 252 | ||
253 | spin_lock (&io->lock); | 253 | spin_lock (&io->lock); |
254 | 254 | ||
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c index 576919927f53..9801d08edacf 100644 --- a/drivers/usb/core/urb.c +++ b/drivers/usb/core/urb.c | |||
@@ -57,7 +57,7 @@ struct urb *usb_alloc_urb(int iso_packets, gfp_t mem_flags) | |||
57 | { | 57 | { |
58 | struct urb *urb; | 58 | struct urb *urb; |
59 | 59 | ||
60 | urb = (struct urb *)kmalloc(sizeof(struct urb) + | 60 | urb = kmalloc(sizeof(struct urb) + |
61 | iso_packets * sizeof(struct usb_iso_packet_descriptor), | 61 | iso_packets * sizeof(struct usb_iso_packet_descriptor), |
62 | mem_flags); | 62 | mem_flags); |
63 | if (!urb) { | 63 | if (!urb) { |