[PATCH] drm/radeon: avoid printing NULL strings
From: Arnd Bergmann
Date: Fri May 15 2026 - 05:23:06 EST
From: Arnd Bergmann <arnd@xxxxxxxx>
gcc-10 warns about some printf format strings that are used to
unconditionally print a NULL string pointer from some call
sites:
In function 'evergreen_surface_check',
inlined from 'evergreen_cs_track_validate_stencil' at drivers/gpu/drm/radeon/evergreen_cs.c:592:6,
inlined from 'evergreen_cs_track_check' at drivers/gpu/drm/radeon/evergreen_cs.c:995:8:
include/linux/dev_printk.h:156:24: error: '%s' directive argument is null [-Werror=format-overflow=]
156 | dev_printk_index_wrap(_dev_warn, KERN_WARNING, dev, dev_fmt(fmt), ##__VA_ARGS__)
This is harmless here because the kernel prints them as "(null)", but
still breaks the build when compiling with -Werror.
Pass empty strings instead to avoid these warnings.
Fixes: 285484e2d55e ("drm/radeon: add support for evergreen/ni tiling informations v11")
Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
---
drivers/gpu/drm/radeon/evergreen_cs.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/radeon/evergreen_cs.c b/drivers/gpu/drm/radeon/evergreen_cs.c
index daaeae6ba141..550e8f35c7d2 100644
--- a/drivers/gpu/drm/radeon/evergreen_cs.c
+++ b/drivers/gpu/drm/radeon/evergreen_cs.c
@@ -589,7 +589,7 @@ static int evergreen_cs_track_validate_stencil(struct radeon_cs_parser *p)
return r;
}
- r = evergreen_surface_check(p, &surf, NULL);
+ r = evergreen_surface_check(p, &surf, "");
if (r) {
/* old userspace doesn't compute proper depth/stencil alignment
* check that alignment against a bigger byte per elements and
@@ -818,7 +818,7 @@ static int evergreen_cs_track_validate_texture(struct radeon_cs_parser *p,
}
/* align height */
- evergreen_surface_check(p, &surf, NULL);
+ evergreen_surface_check(p, &surf, "");
surf.nby = ALIGN(surf.nby, surf.halign);
r = evergreen_surface_check(p, &surf, "texture");
@@ -881,7 +881,7 @@ static int evergreen_cs_track_validate_texture(struct radeon_cs_parser *p,
surf.mode = ARRAY_1D_TILED_THIN1;
}
/* recompute alignment */
- evergreen_surface_check(p, &surf, NULL);
+ evergreen_surface_check(p, &surf, "");
break;
case ARRAY_LINEAR_GENERAL:
case ARRAY_LINEAR_ALIGNED:
--
2.39.5