* [PATCH] firmware: arm_scmi: Use the bitmap API to allocate bitmaps
@ 2022-07-08 19:30 Christophe JAILLET
2022-07-13 10:45 ` Cristian Marussi
2023-03-20 11:19 ` Sudeep Holla
0 siblings, 2 replies; 3+ messages in thread
From: Christophe JAILLET @ 2022-07-08 19:30 UTC (permalink / raw)
To: Sudeep Holla, Cristian Marussi
Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-arm-kernel
Use devm_bitmap_zalloc() instead of hand-writing them.
It is less verbose and it improves the semantic.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/firmware/arm_scmi/driver.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
index 609ebedee9cb..b1265732d83a 100644
--- a/drivers/firmware/arm_scmi/driver.c
+++ b/drivers/firmware/arm_scmi/driver.c
@@ -1911,8 +1911,8 @@ static int __scmi_xfer_info_init(struct scmi_info *sinfo,
hash_init(info->pending_xfers);
/* Allocate a bitmask sized to hold MSG_TOKEN_MAX tokens */
- info->xfer_alloc_table = devm_kcalloc(dev, BITS_TO_LONGS(MSG_TOKEN_MAX),
- sizeof(long), GFP_KERNEL);
+ info->xfer_alloc_table = devm_bitmap_zalloc(dev, MSG_TOKEN_MAX,
+ GFP_KERNEL);
if (!info->xfer_alloc_table)
return -ENOMEM;
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] firmware: arm_scmi: Use the bitmap API to allocate bitmaps
2022-07-08 19:30 [PATCH] firmware: arm_scmi: Use the bitmap API to allocate bitmaps Christophe JAILLET
@ 2022-07-13 10:45 ` Cristian Marussi
2023-03-20 11:19 ` Sudeep Holla
1 sibling, 0 replies; 3+ messages in thread
From: Cristian Marussi @ 2022-07-13 10:45 UTC (permalink / raw)
To: Christophe JAILLET
Cc: Sudeep Holla, linux-kernel, kernel-janitors, linux-arm-kernel
On Fri, Jul 08, 2022 at 09:30:01PM +0200, Christophe JAILLET wrote:
> Use devm_bitmap_zalloc() instead of hand-writing them.
>
> It is less verbose and it improves the semantic.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> drivers/firmware/arm_scmi/driver.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
> index 609ebedee9cb..b1265732d83a 100644
> --- a/drivers/firmware/arm_scmi/driver.c
> +++ b/drivers/firmware/arm_scmi/driver.c
> @@ -1911,8 +1911,8 @@ static int __scmi_xfer_info_init(struct scmi_info *sinfo,
> hash_init(info->pending_xfers);
>
> /* Allocate a bitmask sized to hold MSG_TOKEN_MAX tokens */
> - info->xfer_alloc_table = devm_kcalloc(dev, BITS_TO_LONGS(MSG_TOKEN_MAX),
> - sizeof(long), GFP_KERNEL);
> + info->xfer_alloc_table = devm_bitmap_zalloc(dev, MSG_TOKEN_MAX,
> + GFP_KERNEL);
> if (!info->xfer_alloc_table)
> return -ENOMEM;
>
LGTM.
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Tested-by: Cristian Marussi <cristian.marussi@arm.com>
Thanks,
Cristian
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] firmware: arm_scmi: Use the bitmap API to allocate bitmaps
2022-07-08 19:30 [PATCH] firmware: arm_scmi: Use the bitmap API to allocate bitmaps Christophe JAILLET
2022-07-13 10:45 ` Cristian Marussi
@ 2023-03-20 11:19 ` Sudeep Holla
1 sibling, 0 replies; 3+ messages in thread
From: Sudeep Holla @ 2023-03-20 11:19 UTC (permalink / raw)
To: Cristian Marussi, Christophe JAILLET
Cc: Sudeep Holla, linux-kernel, kernel-janitors, linux-arm-kernel
On Fri, 08 Jul 2022 21:30:01 +0200, Christophe JAILLET wrote:
> Use devm_bitmap_zalloc() instead of hand-writing them.
>
> It is less verbose and it improves the semantic.
>
(sorry for the delay, it seemed to have slipped through the cracks,
thanks to Cristian for pointing this out)
Applied to sudeep.holla/linux (for-next/scmi/fixes), thanks!
[1/1] firmware: arm_scmi: Use the bitmap API to allocate bitmaps
https://git.kernel.org/sudeep.holla/c/d617808e3b83
--
Regards,
Sudeep
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-03-20 11:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-08 19:30 [PATCH] firmware: arm_scmi: Use the bitmap API to allocate bitmaps Christophe JAILLET
2022-07-13 10:45 ` Cristian Marussi
2023-03-20 11:19 ` Sudeep Holla
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).