diff mbox series

[v2] ACPI / property: Switch to bitmap_zalloc()

Message ID 20180830111107.63060-1-andriy.shevchenko@linux.intel.com (mailing list archive)
State Accepted, archived
Delegated to: Rafael Wysocki
Headers show
Series [v2] ACPI / property: Switch to bitmap_zalloc() | expand

Commit Message

Andy Shevchenko Aug. 30, 2018, 11:11 a.m. UTC
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>
---

- resent based on top of recent vanilla
- appended Lukas' Rb tag

 drivers/acpi/x86/apple.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Rafael J. Wysocki Sept. 14, 2018, 8:39 a.m. UTC | #1
On Thursday, August 30, 2018 1:11:07 PM CEST Andy Shevchenko wrote:
> 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>
> ---
> 
> - resent based on top of recent vanilla
> - appended Lukas' Rb tag
> 
>  drivers/acpi/x86/apple.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/acpi/x86/apple.c b/drivers/acpi/x86/apple.c
> index 51b4cf9f25da..bb1984f6c9fe 100644
> --- a/drivers/acpi/x86/apple.c
> +++ b/drivers/acpi/x86/apple.c
> @@ -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);
>  }
> 

Applied, thanks!
diff mbox series

Patch

diff --git a/drivers/acpi/x86/apple.c b/drivers/acpi/x86/apple.c
index 51b4cf9f25da..bb1984f6c9fe 100644
--- a/drivers/acpi/x86/apple.c
+++ b/drivers/acpi/x86/apple.c
@@ -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);
 }