USB gadget: replace kmalloc+memset with kzalloc
PATCH 1/1 USB gadget: replace kmalloc+memset with kzalloc
Hi.
This trivial patch replaces kmalloc+memset with kzalloc in the usb gadget sources.
Regards
Yan Buman
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
Replace kmalloc+memset with kzalloc
Signed-off-by Yan Burman <[email protected]>
drivers/usb/gadget/goku_udc.c +1 -2
@@ -1864,14 +1864,13 @@ static int goku_probe(struct pci_dev *pd }/* alloc, and start init */ - dev =kmalloc (sizeof *dev,SLAB_KERNEL ); + dev =kzalloc (sizeof *dev,SLAB_KERNEL );if (dev ==NULL ){pr_debug ("enomem %s\n" ,pci_name (pdev)); retval = -ENOMEM ; goto done; } -memset (dev,0 ,sizeof *dev);spin_lock_init (&dev->lock); dev->pdev = pdev; dev->gadget.ops = &goku_ops;
drivers/usb/gadget/serial.c +1 -2
@@ -1429,7 +1429,7 @@ static int __init gs_bind(struct usb_gad gs_acm_config_desc.bmAttributes |=USB_CONFIG_ATT_WAKEUP ; } - gs_device = dev =kmalloc (sizeof (struct gs_dev ),GFP_KERNEL ); + gs_device = dev =kzalloc (sizeof (struct gs_dev ),GFP_KERNEL );if (dev ==NULL )return -ENOMEM ;
@@ -1437,7 +1437,6 @@ static int __init gs_bind(struct usb_gadinit_utsname ()->sysname,init_utsname ()->release, gadget->name); -memset (dev,0 ,sizeof (struct gs_dev )); dev->dev_gadget = gadget;spin_lock_init (&dev->dev_lock);INIT_LIST_HEAD (&dev->dev_req_list);