mirror of
https://github.com/torvalds/linux.git
synced 2024-11-14 08:02:07 +00:00
firmware: ti_sci: 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> Signed-off-by: Nishanth Menon <nm@ti.com> Link: https://lore.kernel.org/r/3ee11e9e83f7c1552d237f5c28f554319fcbbf1f.1657308216.git.christophe.jaillet@wanadoo.fr
This commit is contained in:
parent
adf85adc2a
commit
2f9b040275
@ -3201,9 +3201,8 @@ devm_ti_sci_get_resource_sets(const struct ti_sci_handle *handle,
|
||||
|
||||
valid_set = true;
|
||||
res_count = res->desc[i].num + res->desc[i].num_sec;
|
||||
res->desc[i].res_map =
|
||||
devm_kzalloc(dev, BITS_TO_LONGS(res_count) *
|
||||
sizeof(*res->desc[i].res_map), GFP_KERNEL);
|
||||
res->desc[i].res_map = devm_bitmap_zalloc(dev, res_count,
|
||||
GFP_KERNEL);
|
||||
if (!res->desc[i].res_map)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user