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 <christophe.jaillet@wanadoo.fr> Reviewed-by: Cristian Marussi <cristian.marussi@arm.com> Tested-by: Cristian Marussi <cristian.marussi@arm.com> Link: https://lore.kernel.org/r/c073b1607ada34d5bde6ce1009179cf15bbf0da3.1657308593.git.christophe.jaillet@wanadoo.fr Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
This commit is contained in:
parent
2ab4f4018c
commit
d617808e3b
|
@ -2221,8 +2221,8 @@ static int __scmi_xfer_info_init(struct scmi_info *sinfo,
|
||||||
hash_init(info->pending_xfers);
|
hash_init(info->pending_xfers);
|
||||||
|
|
||||||
/* Allocate a bitmask sized to hold MSG_TOKEN_MAX tokens */
|
/* Allocate a bitmask sized to hold MSG_TOKEN_MAX tokens */
|
||||||
info->xfer_alloc_table = devm_kcalloc(dev, BITS_TO_LONGS(MSG_TOKEN_MAX),
|
info->xfer_alloc_table = devm_bitmap_zalloc(dev, MSG_TOKEN_MAX,
|
||||||
sizeof(long), GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!info->xfer_alloc_table)
|
if (!info->xfer_alloc_table)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue