ACPI / property: Switch to bitmap_zalloc()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 30 Aug 2018 11:11:07 +0000 (14:11 +0300)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 10 Sep 2018 10:56:01 +0000 (12:56 +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>
Reviewed-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/x86/apple.c

index 51b4cf9..bb1984f 100644 (file)
@@ -62,7 +62,7 @@ void acpi_extract_apple_properties(struct acpi_device *adev)
        if (!numprops)
                goto out_free;
 
-       valid = kcalloc(BITS_TO_LONGS(numprops), sizeof(long), GFP_KERNEL);
+       valid = bitmap_zalloc(numprops, GFP_KERNEL);
        if (!valid)
                goto out_free;
 
@@ -137,5 +137,5 @@ void acpi_extract_apple_properties(struct acpi_device *adev)
 
 out_free:
        ACPI_FREE(props);
-       kfree(valid);
+       bitmap_free(valid);
 }