diff mbox series

[1/2] drm: mediatek: mtk_drm_plane: Use kmalloc in mtk_plane_duplicate_state

Message ID 20220118133759.112458-1-angelogioacchino.delregno@collabora.com (mailing list archive)
State New, archived
Headers show
Series [1/2] drm: mediatek: mtk_drm_plane: Use kmalloc in mtk_plane_duplicate_state | expand

Commit Message

AngeloGioacchino Del Regno Jan. 18, 2022, 1:37 p.m. UTC
There is no need to zero out the newly allocated memory because we are
duplicating all members of struct mtk_plane_state: switch to kmalloc
to save some overhead.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 drivers/gpu/drm/mediatek/mtk_drm_plane.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Chun-Kuang Hu Jan. 25, 2022, 4:36 p.m. UTC | #1
Hi, AngeloGioacchino:

AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> 於
2022年1月18日 週二 下午9:38寫道:
>
> There is no need to zero out the newly allocated memory because we are
> duplicating all members of struct mtk_plane_state: switch to kmalloc
> to save some overhead.

Reviewed-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>

>
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_drm_plane.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> index c74cb94e445e..39cb9a80d976 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> @@ -57,7 +57,7 @@ static struct drm_plane_state *mtk_plane_duplicate_state(struct drm_plane *plane
>         struct mtk_plane_state *old_state = to_mtk_plane_state(plane->state);
>         struct mtk_plane_state *state;
>
> -       state = kzalloc(sizeof(*state), GFP_KERNEL);
> +       state = kmalloc(sizeof(*state), GFP_KERNEL);
>         if (!state)
>                 return NULL;
>
> --
> 2.33.1
>
AngeloGioacchino Del Regno March 16, 2022, 10:40 a.m. UTC | #2
Il 25/01/22 17:36, Chun-Kuang Hu ha scritto:
> Hi, AngeloGioacchino:
> 
> AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> 於
> 2022年1月18日 週二 下午9:38寫道:
>>
>> There is no need to zero out the newly allocated memory because we are
>> duplicating all members of struct mtk_plane_state: switch to kmalloc
>> to save some overhead.
> 
> Reviewed-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
> 
>>
>> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>> ---
>>   drivers/gpu/drm/mediatek/mtk_drm_plane.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>

Hello,

this series was sent and reviewed two months ago, but it hasn't been picked
in any maintainer tree.

This is a friendly ping to not let these two patches to be lost and forgotten.

Cheers,
Angelo
Chun-Kuang Hu March 16, 2022, 3:12 p.m. UTC | #3
Hi, Angelo:

AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> 於
2022年3月16日 週三 下午6:40寫道:
>
> Il 25/01/22 17:36, Chun-Kuang Hu ha scritto:
> > Hi, AngeloGioacchino:
> >
> > AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> 於
> > 2022年1月18日 週二 下午9:38寫道:
> >>
> >> There is no need to zero out the newly allocated memory because we are
> >> duplicating all members of struct mtk_plane_state: switch to kmalloc
> >> to save some overhead.
> >
> > Reviewed-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
> >
> >>
> >> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> >> ---
> >>   drivers/gpu/drm/mediatek/mtk_drm_plane.c | 2 +-
> >>   1 file changed, 1 insertion(+), 1 deletion(-)
> >>
>
> Hello,
>
> this series was sent and reviewed two months ago, but it hasn't been picked
> in any maintainer tree.
>
> This is a friendly ping to not let these two patches to be lost and forgotten.

For this series, applied to mediatek-drm-next [1], thanks.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-next

Regards,
Chun-Kuang.

>
> Cheers,
> Angelo
diff mbox series

Patch

diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
index c74cb94e445e..39cb9a80d976 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
@@ -57,7 +57,7 @@  static struct drm_plane_state *mtk_plane_duplicate_state(struct drm_plane *plane
 	struct mtk_plane_state *old_state = to_mtk_plane_state(plane->state);
 	struct mtk_plane_state *state;
 
-	state = kzalloc(sizeof(*state), GFP_KERNEL);
+	state = kmalloc(sizeof(*state), GFP_KERNEL);
 	if (!state)
 		return NULL;