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.

scsi: hpsa: 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/5f975ef43f8b7306e4ac4e2e8ce4bcd53f6092bb.1658340441.git.christophe.jaillet@wanadoo.fr
Tested-by: Don Brace <don.brace@microchip.com>
Acked-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Christophe JAILLET and committed by
Martin K. Petersen
5afdd990 de05e484

+2 -4
+2 -4
drivers/scsi/hpsa.c
··· 8030 8030 8031 8031 static void hpsa_free_cmd_pool(struct ctlr_info *h) 8032 8032 { 8033 - kfree(h->cmd_pool_bits); 8033 + bitmap_free(h->cmd_pool_bits); 8034 8034 h->cmd_pool_bits = NULL; 8035 8035 if (h->cmd_pool) { 8036 8036 dma_free_coherent(&h->pdev->dev, ··· 8052 8052 8053 8053 static int hpsa_alloc_cmd_pool(struct ctlr_info *h) 8054 8054 { 8055 - h->cmd_pool_bits = kcalloc(DIV_ROUND_UP(h->nr_cmds, BITS_PER_LONG), 8056 - sizeof(unsigned long), 8057 - GFP_KERNEL); 8055 + h->cmd_pool_bits = bitmap_zalloc(h->nr_cmds, GFP_KERNEL); 8058 8056 h->cmd_pool = dma_alloc_coherent(&h->pdev->dev, 8059 8057 h->nr_cmds * sizeof(*h->cmd_pool), 8060 8058 &h->cmd_pool_dhandle, GFP_KERNEL);