]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
USB: wusbcore: Switch to bitmap_zalloc()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 30 Aug 2018 10:30:11 +0000 (13:30 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 Sep 2018 18:08:21 +0000 (20:08 +0200)
Switch to bitmap_zalloc() to show clearly what we are allocating.
Besides that it returns pointer of bitmap type instead of opaque void *.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/wusbcore/wa-rpipe.c

index 38884aac862b99f820a9f5fc45813fc02ade7bd6..a5734cbcd5ad850b9502c0db153fa37c8d66a822 100644 (file)
@@ -470,9 +470,7 @@ int rpipe_get_by_ep(struct wahc *wa, struct usb_host_endpoint *ep,
 int wa_rpipes_create(struct wahc *wa)
 {
        wa->rpipes = le16_to_cpu(wa->wa_descr->wNumRPipes);
-       wa->rpipe_bm = kcalloc(BITS_TO_LONGS(wa->rpipes),
-                              sizeof(unsigned long),
-                              GFP_KERNEL);
+       wa->rpipe_bm = bitmap_zalloc(wa->rpipes, GFP_KERNEL);
        if (wa->rpipe_bm == NULL)
                return -ENOMEM;
        return 0;
@@ -487,7 +485,7 @@ void wa_rpipes_destroy(struct wahc *wa)
                dev_err(dev, "BUG: pipes not released on exit: %*pb\n",
                        wa->rpipes, wa->rpipe_bm);
        }
-       kfree(wa->rpipe_bm);
+       bitmap_free(wa->rpipe_bm);
 }
 
 /*