projects
/
linux-2.6-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
de8f2c0
)
dmaengine: sh: Use bitmap_zalloc() when applicable
author
Christophe JAILLET
<christophe.jaillet@wanadoo.fr>
Tue, 23 Nov 2021 21:26:18 +0000
(22:26 +0100)
committer
Vinod Koul
<vkoul@kernel.org>
Fri, 17 Dec 2021 16:09:28 +0000
(21:39 +0530)
'shdma_slave_used' is a bitmap. So use 'bitmap_zalloc()' to simplify code,
improve the semantic and avoid some open-coded arithmetic in allocator
arguments.
Also change the corresponding 'kfree()' into 'bitmap_free()' to keep
consistency.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link:
https://lore.kernel.org/r/3efaf2784424ae3d7411dc47f8b6b03e7bb8c059.1637702701.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/sh/shdma-base.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/dma/sh/shdma-base.c
b/drivers/dma/sh/shdma-base.c
index 7f72b3f4cd1aefd083e1c8d8017d682820091cf0..0a2eb5f5a6e87bc4ef3b2c417b9d53d9e15d92ab 100644
(file)
--- a/
drivers/dma/sh/shdma-base.c
+++ b/
drivers/dma/sh/shdma-base.c
@@
-1042,9
+1042,7
@@
EXPORT_SYMBOL(shdma_cleanup);
static int __init shdma_enter(void)
{
- shdma_slave_used = kcalloc(DIV_ROUND_UP(slave_num, BITS_PER_LONG),
- sizeof(long),
- GFP_KERNEL);
+ shdma_slave_used = bitmap_zalloc(slave_num, GFP_KERNEL);
if (!shdma_slave_used)
return -ENOMEM;
return 0;
@@
-1053,7
+1051,7
@@
module_init(shdma_enter);
static void __exit shdma_exit(void)
{
-
k
free(shdma_slave_used);
+
bitmap_
free(shdma_slave_used);
}
module_exit(shdma_exit);