[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Ys6iYFr/nTOmjW7i@e120937-lin>
Date: Wed, 13 Jul 2022 11:45:52 +0100
From: Cristian Marussi <cristian.marussi@....com>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc: Sudeep Holla <sudeep.holla@....com>, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] firmware: arm_scmi: Use the bitmap API to allocate
bitmaps
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@...adoo.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@....com>
Tested-by: Cristian Marussi <cristian.marussi@....com>
Thanks,
Cristian
Powered by blists - more mailing lists