Skip to content

Commit d617808

Browse files
tititiou36sudeep-holla
authored andcommitted
firmware: arm_scmi: Use the bitmap API to allocate bitmaps
Use devm_bitmap_zalloc() instead of hand-writing them. It is less verbose and it improves the semantic. Signed-off-by: Christophe JAILLET <[email protected]> Reviewed-by: Cristian Marussi <[email protected]> Tested-by: Cristian Marussi <[email protected]> Link: https://lore.kernel.org/r/c073b1607ada34d5bde6ce1009179cf15bbf0da3.1657308593.git.christophe.jaillet@wanadoo.fr Signed-off-by: Sudeep Holla <[email protected]>
1 parent 2ab4f40 commit d617808

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/firmware/arm_scmi/driver.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2221,8 +2221,8 @@ static int __scmi_xfer_info_init(struct scmi_info *sinfo,
22212221
hash_init(info->pending_xfers);
22222222

22232223
/* Allocate a bitmask sized to hold MSG_TOKEN_MAX tokens */
2224-
info->xfer_alloc_table = devm_kcalloc(dev, BITS_TO_LONGS(MSG_TOKEN_MAX),
2225-
sizeof(long), GFP_KERNEL);
2224+
info->xfer_alloc_table = devm_bitmap_zalloc(dev, MSG_TOKEN_MAX,
2225+
GFP_KERNEL);
22262226
if (!info->xfer_alloc_table)
22272227
return -ENOMEM;
22282228

0 commit comments

Comments
 (0)