aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/cxl/irq.c
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2022-07-11 21:14:38 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-07-14 16:53:52 +0200
commit4b00b176b3a3bcd4679487c23d333be02e533d93 (patch)
tree691927363832f5fa0cbff8c0cfaaabec43d87cfd /drivers/misc/cxl/irq.c
parentmei: me: fix clang -Wformat warning (diff)
downloadlinux-dev-4b00b176b3a3bcd4679487c23d333be02e533d93.tar.xz
linux-dev-4b00b176b3a3bcd4679487c23d333be02e533d93.zip
cxl: Use the bitmap API to allocate bitmaps
Use bitmap_zalloc()/bitmap_free() instead of hand-writing them. It is less verbose and it improves the semantic. Acked-by: Andrew Donnellan <ajd@linux.ibm.com> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/59010cc7c62443030c69cb1ce0b2b62c5d47e064.1657566849.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/cxl/irq.c')
-rw-r--r--drivers/misc/cxl/irq.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/misc/cxl/irq.c b/drivers/misc/cxl/irq.c
index 5f0e2dcebb34..0ce91d99aead 100644
--- a/drivers/misc/cxl/irq.c
+++ b/drivers/misc/cxl/irq.c
@@ -319,8 +319,7 @@ int afu_allocate_irqs(struct cxl_context *ctx, u32 count)
}
ctx->irq_count = count;
- ctx->irq_bitmap = kcalloc(BITS_TO_LONGS(count),
- sizeof(*ctx->irq_bitmap), GFP_KERNEL);
+ ctx->irq_bitmap = bitmap_zalloc(count, GFP_KERNEL);
if (!ctx->irq_bitmap)
goto out;