Skip to contentSkip to conversation

mmc: core: Calculate size from pointer

PATCH In review Riyan Dhiman 2 participants 2 messages Sep 1, 2024 – Sep 3, 2024 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: core: Calculate size from pointer

Calculate the size from pointer instead of
struct to adhere to linux kernel coding style.

Issue reported by checkpatch.

This commit has no functional changes.

---
 drivers/mmc/core/block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/core/block.c +1 -1
index 2c9963248fcb..dfd495e86985 100644
@@ -2484,7 +2484,7 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
 		return ERR_PTR(devidx);
 	}
 
-	md = kzalloc(sizeof(struct mmc_blk_data), GFP_KERNEL);
+	md = kzalloc(sizeof(*md), GFP_KERNEL);
 	if (!md) {
 		ret = -ENOMEM;
 		goto out;
Signature · 1 line
2.46.0
#1 lore raw
Quoted 9 lines · Riyan Dhiman

Calculate the size from pointer instead of
struct to adhere to linux kernel coding style.

Issue reported by checkpatch.

This commit has no functional changes.

Applied for next, thanks!

Kind regards
Uffe

Quoted 20 lines
---
 drivers/mmc/core/block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/core/block.c +1 -2
index 2c9963248fcb..dfd495e86985 100644
@@ -2484,7 +2484,7 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
                return ERR_PTR(devidx);
        }
 
-       md = kzalloc(sizeof(struct mmc_blk_data), GFP_KERNEL);
+       md = kzalloc(sizeof(*md), GFP_KERNEL);
        if (!md) {
                ret = -ENOMEM;
                goto out;
--

2.46.0