drm/exynos: fix size_t format string
Subsystems (3)
PATCH 1/1 drm/exynos: fix size_t format string
From: Arnd Bergmann <[email protected]>
The exynos_gem->base.size argument is a size_t rather than an unsigned long, so adapt the printk() format string accordingly:
In file included from drivers/gpu/drm/exynos/exynos_drm_gem.c:16:drivers/gpu/drm/exynos/exynos_drm_gem.c: In function 'exynos_drm_alloc_buf':drivers/gpu/drm/exynos/exynos_drm_gem.c:69:49: error: format '%lx' expects argument of type 'long unsigned int', but argument 6 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
69 | DRM_DEV_DEBUG_KMS(drm_dev_dma_dev(dev), "dma_addr(0x%lx), size(0x%lx)\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
70 | (unsigned long)exynos_gem->dma_addr, exynos_gem->base.size);
| ~~~~~~~~~~~~~~~~~~~~~
| |
| size_t {aka unsigned int}The dma_addr in the same line is already printed using a cast to unsigned long, so change that similarly to use the correct %pad format.
--- drivers/gpu/drm/exynos/exynos_drm_gem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_gem.c +4 -4
@@ -66,8 +66,8 @@ static int exynos_drm_alloc_buf(struct exynos_drm_gem *exynos_gem, bool kvmap)if (kvmap) exynos_gem->kvaddr = exynos_gem->cookie; -DRM_DEV_DEBUG_KMS (drm_dev_dma_dev (dev),"dma_addr(0x%lx), size(0x%lx)\n" , - (unsigned long )exynos_gem->dma_addr, exynos_gem->base.size); +DRM_DEV_DEBUG_KMS (drm_dev_dma_dev (dev),"dma_addr(%pad), size(0x%zx)\n" , + &exynos_gem->dma_addr, exynos_gem->base.size);return 0 ; }
@@ -80,8 +80,8 @@ static void exynos_drm_free_buf(struct exynos_drm_gem *exynos_gem)return ; } -DRM_DEV_DEBUG_KMS (dev->dev,"dma_addr(0x%lx), size(0x%lx)\n" , - (unsigned long )exynos_gem->dma_addr, exynos_gem->base.size); +DRM_DEV_DEBUG_KMS (dev->dev,"dma_addr(0x%pad), size(0x%zx)\n" , + &exynos_gem->dma_addr, exynos_gem->base.size); dma_free_attrs(drm_dev_dma_dev(dev), exynos_gem->base.size, exynos_gem->cookie, (dma_addr_t)exynos_gem->dma_addr,
Signature · 1 line
2.39.5
Quoted 16 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The
exynos_gem->base.sizeargument is asize_trather than an unsigned long, so adapt theprintk()format string accordingly:In file included from
drivers/gpu/drm/exynos/exynos_drm_gem.c:16:drivers/gpu/drm/exynos/exynos_drm_gem.c: In function 'exynos_drm_alloc_buf':drivers/gpu/drm/exynos/exynos_drm_gem.c:69:49: error: format '%lx' expects argument of type 'long unsigned int', but argument 6 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]69 | DRM_DEV_DEBUG_KMS(drm_dev_dma_dev(dev), "dma_addr(0x%lx), size(0x%lx)\n", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | (unsigned long)exynos_gem->dma_addr, exynos_gem->base.size); | ~~~~~~~~~~~~~~~~~~~~~ | | | size_t {aka unsigned int}
Quoted 6 lines
The
dma_addrin the same line is already printed using a cast to unsigned long, so change that similarly to use the correct %pad format.Fixes 11e898373fba ("drm/exynos: Drop exynos_drm_gem.size field")Signed-off-by Arnd Bergmann <[email protected]>
I posted the same patch [1] one and a half months ago when the culprit patch was queued up and I got a report about this from the bots.
Inki hasn't picked up my fix yet.
And it seems the exynos-drm-next stuff was only merged into drm-next yesterday, now causing the warnings to pop up all over.
ChenYu
[1] https://lore.kernel.org/all/[email protected]/
Quoted 33 lines
--- drivers/gpu/drm/exynos/exynos_drm_gem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/gpu/drm/exynos/exynos_drm_gem.c +4
-5@@ -66,8 +66,8 @@ static int exynos_drm_alloc_buf(struct exynos_drm_gem *exynos_gem, bool kvmap)if (kvmap) exynos_gem->kvaddr = exynos_gem->cookie; -DRM_DEV_DEBUG_KMS (drm_dev_dma_dev (dev),"dma_addr(0x%lx), size(0x%lx)\n" , - (unsigned long )exynos_gem->dma_addr, exynos_gem->base.size); +DRM_DEV_DEBUG_KMS (drm_dev_dma_dev (dev),"dma_addr(%pad), size(0x%zx)\n" , + &exynos_gem->dma_addr, exynos_gem->base.size);return 0 ; }@@ -80,8 +80,8 @@ static void exynos_drm_free_buf(struct exynos_drm_gem *exynos_gem)return ; } -DRM_DEV_DEBUG_KMS (dev->dev,"dma_addr(0x%lx), size(0x%lx)\n" , - (unsigned long )exynos_gem->dma_addr, exynos_gem->base.size); +DRM_DEV_DEBUG_KMS (dev->dev,"dma_addr(0x%pad), size(0x%zx)\n" , + &exynos_gem->dma_addr, exynos_gem->base.size); dma_free_attrs(drm_dev_dma_dev(dev), exynos_gem->base.size, exynos_gem->cookie, (dma_addr_t)exynos_gem->dma_addr, --2.39.5
Quoted 24 lines · Chen-Yu Tsai
Quoted 16 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The
exynos_gem->base.sizeargument is asize_trather than an unsigned long, so adapt theprintk()format string accordingly:In file included from
drivers/gpu/drm/exynos/exynos_drm_gem.c:16:drivers/gpu/drm/exynos/exynos_drm_gem.c: In function 'exynos_drm_alloc_buf':drivers/gpu/drm/exynos/exynos_drm_gem.c:69:49: error: format '%lx' expects argument of type 'long unsigned int', but argument 6 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]69 | DRM_DEV_DEBUG_KMS(drm_dev_dma_dev(dev), "dma_addr(0x%lx), size(0x%lx)\n", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | (unsigned long)exynos_gem->dma_addr, exynos_gem->base.size); | ~~~~~~~~~~~~~~~~~~~~~ | | | size_t {aka unsigned int}Quoted 6 lines
The
dma_addrin the same line is already printed using a cast to unsigned long, so change that similarly to use the correct %pad format.Fixes 11e898373fba ("drm/exynos: Drop exynos_drm_gem.size field")Signed-off-by Arnd Bergmann <[email protected]>
Quoted 7 lines
I posted the same patch [1] one and a half months ago when the culprit patch was queued up and I got a report about this from the bots.
Inki hasn't picked up my fix yet.
And it seems the exynos-drm-next stuff was only merged into drm-next yesterday, now causing the warnings to pop up all over.
Yeah that's some pretty bad fail for exynos and I guess also for Dave for not compile-testing on 32bit before pushing drm-next out. I've noticed it just this morning trying to do some stuff.
Picked up Arnd's patch as the first one that I've found (after I've typed it myself already, but hey let's at least give some credit).
Cheers, Sima
Quoted 38 lines
ChenYu
[1] https://lore.kernel.org/all/[email protected]/
Quoted 33 lines
--- drivers/gpu/drm/exynos/exynos_drm_gem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/gpu/drm/exynos/exynos_drm_gem.c +4
-5@@ -66,8 +66,8 @@ static int exynos_drm_alloc_buf(struct exynos_drm_gem *exynos_gem, bool kvmap)if (kvmap) exynos_gem->kvaddr = exynos_gem->cookie; -DRM_DEV_DEBUG_KMS (drm_dev_dma_dev (dev),"dma_addr(0x%lx), size(0x%lx)\n" , - (unsigned long )exynos_gem->dma_addr, exynos_gem->base.size); +DRM_DEV_DEBUG_KMS (drm_dev_dma_dev (dev),"dma_addr(%pad), size(0x%zx)\n" , + &exynos_gem->dma_addr, exynos_gem->base.size);return 0 ; }@@ -80,8 +80,8 @@ static void exynos_drm_free_buf(struct exynos_drm_gem *exynos_gem)return ; } -DRM_DEV_DEBUG_KMS (dev->dev,"dma_addr(0x%lx), size(0x%lx)\n" , - (unsigned long )exynos_gem->dma_addr, exynos_gem->base.size); +DRM_DEV_DEBUG_KMS (dev->dev,"dma_addr(0x%pad), size(0x%zx)\n" , + &exynos_gem->dma_addr, exynos_gem->base.size); dma_free_attrs(drm_dev_dma_dev(dev), exynos_gem->base.size, exynos_gem->cookie, (dma_addr_t)exynos_gem->dma_addr, --2.39.5
Signature · 3 lines
Simona Vetter Software Engineer http://blog.ffwll.ch
2026년 5월 28일 (목) 오전 6:05, Chen-Yu Tsai <[email protected]>님이 작성:
Quoted 22 lines · Arnd Bergmann
Quoted 20 lines
From: Arnd Bergmann <[email protected]>
The
exynos_gem->base.sizeargument is asize_trather than an unsigned long, so adapt theprintk()format string accordingly:In file included from
drivers/gpu/drm/exynos/exynos_drm_gem.c:16:drivers/gpu/drm/exynos/exynos_drm_gem.c: In function 'exynos_drm_alloc_buf':drivers/gpu/drm/exynos/exynos_drm_gem.c:69:49: error: format '%lx' expects argument of type 'long unsigned int', but argument 6 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]69 | DRM_DEV_DEBUG_KMS(drm_dev_dma_dev(dev), "dma_addr(0x%lx), size(0x%lx)\n", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | (unsigned long)exynos_gem->dma_addr, exynos_gem->base.size); | ~~~~~~~~~~~~~~~~~~~~~ | | | size_t {aka unsigned int}The
dma_addrin the same line is already printed using a cast to unsigned long, so change that similarly to use the correct %pad format.
Quoted 7 lines
Quoted 2 lines
Fixes 11e898373fba ("drm/exynos: Drop exynos_drm_gem.size field")Signed-off-by Arnd Bergmann <[email protected]>I posted the same patch [1] one and a half months ago when the culprit patch was queued up and I got a report about this from the bots.
Inki hasn't picked up my fix yet.
Really sorry for this. I missed your patch.
Thanks,
inki Dae
Quoted 42 lines
And it seems the exynos-drm-next stuff was only merged into drm-next yesterday, now causing the warnings to pop up all over.
ChenYu
[1] https://lore.kernel.org/all/[email protected]/
Quoted 33 lines
--- drivers/gpu/drm/exynos/exynos_drm_gem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/gpu/drm/exynos/exynos_drm_gem.c +4
-5@@ -66,8 +66,8 @@ static int exynos_drm_alloc_buf(struct exynos_drm_gem *exynos_gem, bool kvmap)if (kvmap) exynos_gem->kvaddr = exynos_gem->cookie; -DRM_DEV_DEBUG_KMS (drm_dev_dma_dev (dev),"dma_addr(0x%lx), size(0x%lx)\n" , - (unsigned long )exynos_gem->dma_addr, exynos_gem->base.size); +DRM_DEV_DEBUG_KMS (drm_dev_dma_dev (dev),"dma_addr(%pad), size(0x%zx)\n" , + &exynos_gem->dma_addr, exynos_gem->base.size);return 0 ; }@@ -80,8 +80,8 @@ static void exynos_drm_free_buf(struct exynos_drm_gem *exynos_gem)return ; } -DRM_DEV_DEBUG_KMS (dev->dev,"dma_addr(0x%lx), size(0x%lx)\n" , - (unsigned long )exynos_gem->dma_addr, exynos_gem->base.size); +DRM_DEV_DEBUG_KMS (dev->dev,"dma_addr(0x%pad), size(0x%zx)\n" , + &exynos_gem->dma_addr, exynos_gem->base.size); dma_free_attrs(drm_dev_dma_dev(dev), exynos_gem->base.size, exynos_gem->cookie, (dma_addr_t)exynos_gem->dma_addr, --2.39.5
Quoted 16 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The
exynos_gem->base.sizeargument is asize_trather than an unsigned long, so adapt theprintk()format string accordingly:In file included from
drivers/gpu/drm/exynos/exynos_drm_gem.c:16:drivers/gpu/drm/exynos/exynos_drm_gem.c: In function 'exynos_drm_alloc_buf':drivers/gpu/drm/exynos/exynos_drm_gem.c:69:49: error: format '%lx' expects argument of type 'long unsigned int', but argument 6 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]69 | DRM_DEV_DEBUG_KMS(drm_dev_dma_dev(dev), "dma_addr(0x%lx), size(0x%lx)\n", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | (unsigned long)exynos_gem->dma_addr, exynos_gem->base.size); | ~~~~~~~~~~~~~~~~~~~~~ | | | size_t {aka unsigned int}
Quoted 7 lines
The
dma_addrin the same line is already printed using a cast to unsigned long, so change that similarly to use the correct %pad format.Fixes 11e898373fba ("drm/exynos: Drop exynos_drm_gem.size field")Signed-off-by Arnd Bergmann <[email protected]>---
Hello,
Quoted 41 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The
exynos_gem->base.sizeargument is asize_trather than an unsigned long, so adapt theprintk()format string accordingly:In file included from
drivers/gpu/drm/exynos/exynos_drm_gem.c:16:drivers/gpu/drm/exynos/exynos_drm_gem.c: In function 'exynos_drm_alloc_buf':drivers/gpu/drm/exynos/exynos_drm_gem.c:69:49: error: format '%lx' expects argument of type 'long unsigned int', but argument 6 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]69 | DRM_DEV_DEBUG_KMS(drm_dev_dma_dev(dev), "dma_addr(0x%lx), size(0x%lx)\n", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | (unsigned long)exynos_gem->dma_addr, exynos_gem->base.size); | ~~~~~~~~~~~~~~~~~~~~~ | | | size_t {aka unsigned int}The
dma_addrin the same line is already printed using a cast to unsigned long, so change that similarly to use the correct %pad format.Fixes 11e898373fba ("drm/exynos: Drop exynos_drm_gem.size field")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_gem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/gpu/drm/exynos/exynos_drm_gem.c +2
-2@@ -66,8 +66,8 @@ static int exynos_drm_alloc_buf(struct exynos_drm_gem *exynos_gem, bool kvmap)if (kvmap) exynos_gem->kvaddr = exynos_gem->cookie; -DRM_DEV_DEBUG_KMS (drm_dev_dma_dev (dev),"dma_addr(0x%lx), size(0x%lx)\n" , - (unsigned long )exynos_gem->dma_addr, exynos_gem->base.size); +DRM_DEV_DEBUG_KMS (drm_dev_dma_dev (dev),"dma_addr(%pad), size(0x%zx)\n" , + &exynos_gem->dma_addr, exynos_gem->base.size);return 0 ; }
drivers/gpu/drm/exynos/exynos_drm_gem.c static void exynos_drm_free_buf(struct exynos_drm_gem *exynos_gem) · line 84
Quoted 7 lines
drivers/gpu/drm/exynos/exynos_drm_gem.c +2
-2@@ -80,8 +80,8 @@ static void exynos_drm_free_buf(struct exynos_drm_gem *exynos_gem)return ; } -DRM_DEV_DEBUG_KMS (dev->dev,"dma_addr(0x%lx), size(0x%lx)\n" , - (unsigned long )exynos_gem->dma_addr, exynos_gem->base.size); +DRM_DEV_DEBUG_KMS (dev->dev,"dma_addr(0x%pad), size(0x%zx)\n" , + &exynos_gem->dma_addr, exynos_gem->base.size);
Inconsistent formatting. The first hunk used dma_addr(%pad), the second adds "0x". Chen-Yu Tsai's patch[1] was better in that regard.
Best regards
Uwe