soc: qcom: llcc: Use devm_bitmap_zalloc() when applicable
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Thu, 23 Dec 2021 07:54:41 +0000 (08:54 +0100)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Mon, 31 Jan 2022 21:42:19 +0000 (15:42 -0600)
'drv_data->bitmap' is a bitmap. So use 'devm_bitmap_zalloc()' to simplify
code, improve the semantic.

This also fixes a spurious indentation.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/3ee83f75afa8754fade4fff6a03b57f0ae3ccc28.1640245993.git.christophe.jaillet@wanadoo.fr
drivers/soc/qcom/llcc-qcom.c

index ec52f29c886733b7fbdbd9f54542fe6170a540c1..00274a93406bc2f51f66db36f29666a3b9877b26 100644 (file)
@@ -632,9 +632,8 @@ static int qcom_llcc_probe(struct platform_device *pdev)
        for (i = 0; i < num_banks; i++)
                drv_data->offsets[i] = i * BANK_OFFSET_STRIDE;
 
-       drv_data->bitmap = devm_kcalloc(dev,
-       BITS_TO_LONGS(drv_data->max_slices), sizeof(unsigned long),
-                                               GFP_KERNEL);
+       drv_data->bitmap = devm_bitmap_zalloc(dev, drv_data->max_slices,
+                                             GFP_KERNEL);
        if (!drv_data->bitmap) {
                ret = -ENOMEM;
                goto err;