projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c07f216
)
firmware: ti_sci: Use devm_bitmap_zalloc when applicable
author
Christophe JAILLET
<christophe.jaillet@wanadoo.fr>
Thu, 3 Nov 2022 06:41:30 +0000
(07:41 +0100)
committer
Nishanth Menon
<nm@ti.com>
Fri, 4 Nov 2022 02:45:10 +0000
(21:45 -0500)
'xfer_alloc_table' is a bitmap. So use 'devm_bitmap_zalloc()' to simplify
code and improve the semantic of the code.
While at it, remove a redundant 'bitmap_zero()' call.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Link:
https://lore.kernel.org/r/43ab1a7dd073d0d037d5d4bbbd5f8335de605826.1667457664.git.christophe.jaillet@wanadoo.fr
drivers/firmware/ti_sci.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/firmware/ti_sci.c
b/drivers/firmware/ti_sci.c
index 6d2fd0ff7ff3a22103ad54566df20fcd28c9e1b8..039d92a595ec6873fd8d34fbe7a939abfb947bc0 100644
(file)
--- a/
drivers/firmware/ti_sci.c
+++ b/
drivers/firmware/ti_sci.c
@@
-3398,13
+3398,11
@@
static int ti_sci_probe(struct platform_device *pdev)
if (!minfo->xfer_block)
return -ENOMEM;
- minfo->xfer_alloc_table = devm_kcalloc(dev,
- BITS_TO_LONGS(desc->max_msgs),
- sizeof(unsigned long),
- GFP_KERNEL);
+ minfo->xfer_alloc_table = devm_bitmap_zalloc(dev,
+ desc->max_msgs,
+ GFP_KERNEL);
if (!minfo->xfer_alloc_table)
return -ENOMEM;
- bitmap_zero(minfo->xfer_alloc_table, desc->max_msgs);
/* Pre-initialize the buffer pointer to pre-allocated buffers */
for (i = 0, xfer = minfo->xfer_block; i < desc->max_msgs; i++, xfer++) {