diff mbox series

drm/mediatek: stop using 0 as NULL pointer

Message ID 20230110031223.4820-1-miles.chen@mediatek.com (mailing list archive)
State New, archived
Headers show
Series drm/mediatek: stop using 0 as NULL pointer | expand

Commit Message

Miles Chen Jan. 10, 2023, 3:12 a.m. UTC
Use NULL for NULL pointer to fix the following sparse warning:
drivers/gpu/drm/mediatek/mtk_drm_gem.c:265:27: sparse: warning: Using plain integer as NULL pointer

Signed-off-by: Miles Chen <miles.chen@mediatek.com>

---
 drivers/gpu/drm/mediatek/mtk_drm_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

AngeloGioacchino Del Regno Jan. 10, 2023, 9:36 a.m. UTC | #1
Il 10/01/23 04:12, Miles Chen ha scritto:
> Use NULL for NULL pointer to fix the following sparse warning:
> drivers/gpu/drm/mediatek/mtk_drm_gem.c:265:27: sparse: warning: Using plain integer as NULL pointer
> 
> Signed-off-by: Miles Chen <miles.chen@mediatek.com>

Please add the appropriate tag...

Fixes: 3df64d7b0a4f ("drm/mediatek: Implement gem prime vmap/vunmap function")

after which:

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Miles Chen Jan. 11, 2023, 2:42 a.m. UTC | #2
Hi Angelo,

>Il 10/01/23 04:12, Miles Chen ha scritto:
>> Use NULL for NULL pointer to fix the following sparse warning:
>> drivers/gpu/drm/mediatek/mtk_drm_gem.c:265:27: sparse: warning: Using plain integer as NULL pointer
>> 
>> Signed-off-by: Miles Chen <miles.chen@mediatek.com>
>
>Please add the appropriate tag...
>
>Fixes: 3df64d7b0a4f ("drm/mediatek: Implement gem prime vmap/vunmap function")

No problem, I will add the Fixes tag and submit v2.

thanks,
Miles

>
>after which:
>
>Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/mediatek/mtk_drm_gem.c b/drivers/gpu/drm/mediatek/mtk_drm_gem.c
index 47e96b0289f9..06aadd5e7f5b 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_gem.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_gem.c
@@ -262,6 +262,6 @@  void mtk_drm_gem_prime_vunmap(struct drm_gem_object *obj,
 		return;
 
 	vunmap(vaddr);
-	mtk_gem->kvaddr = 0;
+	mtk_gem->kvaddr = NULL;
 	kfree(mtk_gem->pages);
 }