Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] USB: convert kcalloc to kzalloc

This patch converts kcalloc(1, ...) calls to use the new kzalloc() function.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Pekka Enberg and committed by
Linus Torvalds
7b842b6e a97e148a

+8 -8
+1 -1
drivers/usb/atm/usbatm.c
··· 960 960 intf->altsetting->desc.bInterfaceNumber); 961 961 962 962 /* instance init */ 963 - instance = kcalloc(1, sizeof(*instance) + sizeof(struct urb *) * (num_rcv_urbs + num_snd_urbs), GFP_KERNEL); 963 + instance = kzalloc(sizeof(*instance) + sizeof(struct urb *) * (num_rcv_urbs + num_snd_urbs), GFP_KERNEL); 964 964 if (!instance) { 965 965 dev_dbg(dev, "%s: no memory for instance data!\n", __func__); 966 966 return -ENOMEM;
+1 -1
drivers/usb/core/hcd.c
··· 1669 1669 { 1670 1670 struct usb_hcd *hcd; 1671 1671 1672 - hcd = kcalloc(1, sizeof(*hcd) + driver->hcd_priv_size, GFP_KERNEL); 1672 + hcd = kzalloc(sizeof(*hcd) + driver->hcd_priv_size, GFP_KERNEL); 1673 1673 if (!hcd) { 1674 1674 dev_dbg (dev, "hcd alloc failed\n"); 1675 1675 return NULL;
+1 -1
drivers/usb/host/ehci-sched.c
··· 638 638 { 639 639 struct ehci_iso_stream *stream; 640 640 641 - stream = kcalloc(1, sizeof *stream, mem_flags); 641 + stream = kzalloc(sizeof *stream, mem_flags); 642 642 if (likely (stream != NULL)) { 643 643 INIT_LIST_HEAD(&stream->td_list); 644 644 INIT_LIST_HEAD(&stream->free_list);
+1 -1
drivers/usb/host/isp116x-hcd.c
··· 717 717 } 718 718 /* avoid all allocations within spinlocks: request or endpoint */ 719 719 if (!hep->hcpriv) { 720 - ep = kcalloc(1, sizeof *ep, mem_flags); 720 + ep = kzalloc(sizeof *ep, mem_flags); 721 721 if (!ep) 722 722 return -ENOMEM; 723 723 }
+1 -1
drivers/usb/host/sl811-hcd.c
··· 835 835 836 836 /* avoid all allocations within spinlocks */ 837 837 if (!hep->hcpriv) 838 - ep = kcalloc(1, sizeof *ep, mem_flags); 838 + ep = kzalloc(sizeof *ep, mem_flags); 839 839 840 840 spin_lock_irqsave(&sl811->lock, flags); 841 841
+1 -1
drivers/usb/input/acecad.c
··· 152 152 pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress); 153 153 maxp = usb_maxpacket(dev, pipe, usb_pipeout(pipe)); 154 154 155 - acecad = kcalloc(1, sizeof(struct usb_acecad), GFP_KERNEL); 155 + acecad = kzalloc(sizeof(struct usb_acecad), GFP_KERNEL); 156 156 if (!acecad) 157 157 return -ENOMEM; 158 158
+1 -1
drivers/usb/input/itmtouch.c
··· 166 166 interface = intf->cur_altsetting; 167 167 endpoint = &interface->endpoint[0].desc; 168 168 169 - if (!(itmtouch = kcalloc(1, sizeof(struct itmtouch_dev), GFP_KERNEL))) { 169 + if (!(itmtouch = kzalloc(sizeof(struct itmtouch_dev), GFP_KERNEL))) { 170 170 err("%s - Out of memory.", __FUNCTION__); 171 171 return -ENOMEM; 172 172 }
+1 -1
drivers/usb/input/pid.c
··· 263 263 struct hid_ff_pid *private; 264 264 struct hid_input *hidinput = list_entry(&hid->inputs, struct hid_input, list); 265 265 266 - private = hid->ff_private = kcalloc(1, sizeof(struct hid_ff_pid), GFP_KERNEL); 266 + private = hid->ff_private = kzalloc(sizeof(struct hid_ff_pid), GFP_KERNEL); 267 267 if (!private) 268 268 return -ENOMEM; 269 269