Commit b577ea54 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Leon Romanovsky
Browse files

RDMA/qib: 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.

Link: https://lore.kernel.org/r/f7a8588447679e80a438b6188b0603c1a11ad877.1657300671.git.christophe.jaillet@wanadoo.fr


Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: default avatarDennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
parent 3a844596
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -1106,8 +1106,7 @@ struct qib_devdata *qib_alloc_devdata(struct pci_dev *pdev, size_t extra)
	if (!qib_cpulist_count) {
		u32 count = num_online_cpus();

		qib_cpulist = kcalloc(BITS_TO_LONGS(count), sizeof(long),
				      GFP_KERNEL);
		qib_cpulist = bitmap_zalloc(count, GFP_KERNEL);
		if (qib_cpulist)
			qib_cpulist_count = count;
	}
@@ -1279,7 +1278,7 @@ static void __exit qib_ib_cleanup(void)
#endif

	qib_cpulist_count = 0;
	kfree(qib_cpulist);
	bitmap_free(qib_cpulist);

	WARN_ON(!xa_empty(&qib_dev_table));
	qib_dev_cleanup();