uwb: use kcalloc where appropriate
authorDavid Vrabel <dv02@dv02pc01.europe.root.pri>
Wed, 15 Oct 2008 13:50:10 +0000 (14:50 +0100)
committerDavid Vrabel <dv02@dv02pc01.europe.root.pri>
Wed, 15 Oct 2008 13:50:10 +0000 (14:50 +0100)
Signed-off-by: David Vrabel <david.vrabel@csr.com>
drivers/usb/wusbcore/mmc.c
drivers/usb/wusbcore/wa-xfer.c
drivers/uwb/lc-dev.c

index e5390b77aaaaf6ee12895d89f941b681680b6682..76907286f156792709d88cc47b08a8910d383fab 100644 (file)
@@ -43,7 +43,7 @@
 int wusbhc_mmcie_create(struct wusbhc *wusbhc)
 {
        u8 mmcies = wusbhc->mmcies_max;
-       wusbhc->mmcie = kzalloc(mmcies * sizeof(wusbhc->mmcie[0]), GFP_KERNEL);
+       wusbhc->mmcie = kcalloc(mmcies, sizeof(wusbhc->mmcie[0]), GFP_KERNEL);
        if (wusbhc->mmcie == NULL)
                return -ENOMEM;
        mutex_init(&wusbhc->mmcie_mutex);
index 7d192f3e674211f833407ec8836fe3501ccdc34c..c038635d1c64efb825f6d16dc8bd44b61ee98ab4 100644 (file)
@@ -674,7 +674,7 @@ static int __wa_xfer_setup_segs(struct wa_xfer *xfer, size_t xfer_hdr_size)
        size_t buf_itr, buf_size, buf_itr_size;
 
        result = -ENOMEM;
-       xfer->seg = kzalloc(xfer->segs * sizeof(xfer->seg[0]), GFP_ATOMIC);
+       xfer->seg = kcalloc(xfer->segs, sizeof(xfer->seg[0]), GFP_ATOMIC);
        if (xfer->seg == NULL)
                goto error_segs_kzalloc;
        buf_itr = 0;
index a6cb8ad731a6ce132d85a6cdbc7f20a6db0a4a9c..15f856c9689af8b3d728d4bd67f9be971b52d7b6 100644 (file)
@@ -443,7 +443,7 @@ void uwbd_dev_onair(struct uwb_rc *rc, struct uwb_beca_e *bce)
 
        uwb_mac_addr_print(macbuf, sizeof(macbuf), bce->mac_addr);
        uwb_dev_addr_print(devbuf, sizeof(devbuf), &bce->dev_addr);
-       uwb_dev = kcalloc(1, sizeof(*uwb_dev), GFP_KERNEL);
+       uwb_dev = kzalloc(sizeof(struct uwb_dev), GFP_KERNEL);
        if (uwb_dev == NULL) {
                dev_err(dev, "new device %s: Cannot allocate memory\n",
                        macbuf);