* [PATCH] mmc: core: Calculate size from pointer
@ 2024-09-01 17:33 Riyan Dhiman
2024-09-03 12:37 ` Ulf Hansson
0 siblings, 1 reply; 2+ messages in thread
From: Riyan Dhiman @ 2024-09-01 17:33 UTC (permalink / raw)
To: ulf.hansson; +Cc: linux-mmc, linux-kernel, 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.
Signed-off-by: Riyan Dhiman <riyandhiman14@gmail.com>
---
drivers/mmc/core/block.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index 2c9963248fcb..dfd495e86985 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mmc: core: Calculate size from pointer
2024-09-01 17:33 [PATCH] mmc: core: Calculate size from pointer Riyan Dhiman
@ 2024-09-03 12:37 ` Ulf Hansson
0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2024-09-03 12:37 UTC (permalink / raw)
To: Riyan Dhiman; +Cc: linux-mmc, linux-kernel
On Sun, 1 Sept 2024 at 19:33, Riyan Dhiman <riyandhiman14@gmail.com> wrote:
>
> 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.
>
> Signed-off-by: Riyan Dhiman <riyandhiman14@gmail.com>
Applied for next, thanks!
Kind regards
Uffe
> ---
> drivers/mmc/core/block.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
> index 2c9963248fcb..dfd495e86985 100644
> --- a/drivers/mmc/core/block.c
> +++ b/drivers/mmc/core/block.c
> @@ -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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-09-03 12:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-01 17:33 [PATCH] mmc: core: Calculate size from pointer Riyan Dhiman
2024-09-03 12:37 ` Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox