Commit ace56935 authored by Stephen Boyd's avatar Stephen Boyd Committed by Linus Walleij

gpiolib: Change bitmap allocation to kmalloc_array

We don't need to clear out these bits when we set them immediately
after. Use kmalloc_array() to skip clearing the bits.
Suggested-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarStephen Boyd <swboyd@chromium.org>
Tested-by: default avatarTimur Tabi <timur@codeaurora.org>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent e4371f6e
...@@ -341,7 +341,7 @@ static unsigned long *gpiochip_allocate_mask(struct gpio_chip *chip) ...@@ -341,7 +341,7 @@ static unsigned long *gpiochip_allocate_mask(struct gpio_chip *chip)
{ {
unsigned long *p; unsigned long *p;
p = kcalloc(BITS_TO_LONGS(chip->ngpio), sizeof(long), GFP_KERNEL); p = kmalloc_array(BITS_TO_LONGS(chip->ngpio), sizeof(*p), GFP_KERNEL);
if (!p) if (!p)
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment