[PATCH] USB: Remove unneeded kmalloc() return value casts
Remove kmalloc() return value casts that we don't need from drivers/usb/* Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
740a4282ed
commit
0e8eb0f06b
|
@ -725,7 +725,7 @@ int usbvideo_register(
|
||||||
/* Allocate user_data separately because of kmalloc's limits */
|
/* Allocate user_data separately because of kmalloc's limits */
|
||||||
if (num_extra > 0) {
|
if (num_extra > 0) {
|
||||||
up->user_size = num_cams * num_extra;
|
up->user_size = num_cams * num_extra;
|
||||||
up->user_data = (char *) kmalloc(up->user_size, GFP_KERNEL);
|
up->user_data = kmalloc(up->user_size, GFP_KERNEL);
|
||||||
if (up->user_data == NULL) {
|
if (up->user_data == NULL) {
|
||||||
err("%s: Failed to allocate user_data (%d. bytes)",
|
err("%s: Failed to allocate user_data (%d. bytes)",
|
||||||
__FUNCTION__, up->user_size);
|
__FUNCTION__, up->user_size);
|
||||||
|
|
|
@ -3554,7 +3554,7 @@ w9968cf_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
|
||||||
|
|
||||||
|
|
||||||
/* Allocate 2 bytes of memory for camera control USB transfers */
|
/* Allocate 2 bytes of memory for camera control USB transfers */
|
||||||
if (!(cam->control_buffer = (u16*)kmalloc(2, GFP_KERNEL))) {
|
if (!(cam->control_buffer = kmalloc(2, GFP_KERNEL))) {
|
||||||
DBG(1,"Couldn't allocate memory for camera control transfers")
|
DBG(1,"Couldn't allocate memory for camera control transfers")
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
goto fail;
|
goto fail;
|
||||||
|
@ -3562,7 +3562,7 @@ w9968cf_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
|
||||||
memset(cam->control_buffer, 0, 2);
|
memset(cam->control_buffer, 0, 2);
|
||||||
|
|
||||||
/* Allocate 8 bytes of memory for USB data transfers to the FSB */
|
/* Allocate 8 bytes of memory for USB data transfers to the FSB */
|
||||||
if (!(cam->data_buffer = (u16*)kmalloc(8, GFP_KERNEL))) {
|
if (!(cam->data_buffer = kmalloc(8, GFP_KERNEL))) {
|
||||||
DBG(1, "Couldn't allocate memory for data "
|
DBG(1, "Couldn't allocate memory for data "
|
||||||
"transfers to the FSB")
|
"transfers to the FSB")
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
|
|
|
@ -767,7 +767,7 @@ static int auerbuf_setup (pauerbufctl_t bcp, unsigned int numElements, unsigned
|
||||||
memset (bep, 0, sizeof (auerbuf_t));
|
memset (bep, 0, sizeof (auerbuf_t));
|
||||||
bep->list = bcp;
|
bep->list = bcp;
|
||||||
INIT_LIST_HEAD (&bep->buff_list);
|
INIT_LIST_HEAD (&bep->buff_list);
|
||||||
bep->bufp = (char *) kmalloc (bufsize, GFP_KERNEL);
|
bep->bufp = kmalloc (bufsize, GFP_KERNEL);
|
||||||
if (!bep->bufp)
|
if (!bep->bufp)
|
||||||
goto bl_fail;
|
goto bl_fail;
|
||||||
bep->dr = (struct usb_ctrlrequest *) kmalloc (sizeof (struct usb_ctrlrequest), GFP_KERNEL);
|
bep->dr = (struct usb_ctrlrequest *) kmalloc (sizeof (struct usb_ctrlrequest), GFP_KERNEL);
|
||||||
|
@ -1123,7 +1123,7 @@ static int auerswald_int_open (pauerswald_t cp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!cp->intbufp) {
|
if (!cp->intbufp) {
|
||||||
cp->intbufp = (char *) kmalloc (irqsize, GFP_KERNEL);
|
cp->intbufp = kmalloc (irqsize, GFP_KERNEL);
|
||||||
if (!cp->intbufp) {
|
if (!cp->intbufp) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto intoend;
|
goto intoend;
|
||||||
|
|
|
@ -465,14 +465,14 @@ static int probe_rio(struct usb_interface *intf,
|
||||||
|
|
||||||
rio->rio_dev = dev;
|
rio->rio_dev = dev;
|
||||||
|
|
||||||
if (!(rio->obuf = (char *) kmalloc(OBUF_SIZE, GFP_KERNEL))) {
|
if (!(rio->obuf = kmalloc(OBUF_SIZE, GFP_KERNEL))) {
|
||||||
err("probe_rio: Not enough memory for the output buffer");
|
err("probe_rio: Not enough memory for the output buffer");
|
||||||
usb_deregister_dev(intf, &usb_rio_class);
|
usb_deregister_dev(intf, &usb_rio_class);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
dbg("probe_rio: obuf address:%p", rio->obuf);
|
dbg("probe_rio: obuf address:%p", rio->obuf);
|
||||||
|
|
||||||
if (!(rio->ibuf = (char *) kmalloc(IBUF_SIZE, GFP_KERNEL))) {
|
if (!(rio->ibuf = kmalloc(IBUF_SIZE, GFP_KERNEL))) {
|
||||||
err("probe_rio: Not enough memory for the input buffer");
|
err("probe_rio: Not enough memory for the input buffer");
|
||||||
usb_deregister_dev(intf, &usb_rio_class);
|
usb_deregister_dev(intf, &usb_rio_class);
|
||||||
kfree(rio->obuf);
|
kfree(rio->obuf);
|
||||||
|
|
Loading…
Reference in New Issue