Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dmaengine: sh: Use bitmap_zalloc() when applicable

'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>

authored by

Christophe JAILLET and committed by
Vinod Koul
d5aeba45 de8f2c05

+2 -4
+2 -4
drivers/dma/sh/shdma-base.c
··· 1042 1042 1043 1043 static int __init shdma_enter(void) 1044 1044 { 1045 - shdma_slave_used = kcalloc(DIV_ROUND_UP(slave_num, BITS_PER_LONG), 1046 - sizeof(long), 1047 - GFP_KERNEL); 1045 + shdma_slave_used = bitmap_zalloc(slave_num, GFP_KERNEL); 1048 1046 if (!shdma_slave_used) 1049 1047 return -ENOMEM; 1050 1048 return 0; ··· 1051 1053 1052 1054 static void __exit shdma_exit(void) 1053 1055 { 1054 - kfree(shdma_slave_used); 1056 + bitmap_free(shdma_slave_used); 1055 1057 } 1056 1058 module_exit(shdma_exit); 1057 1059