The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: "Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Dave Airlie" <airlied@redhat.com>,
	"Jerome Glisse" <jglisse@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>, Chris Down <chris@chrisdown.name>,
	"Borislav Petkov (AMD)" <bp@alien8.de>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] drm/radeon: avoid printing NULL strings
Date: Fri, 15 May 2026 11:10:26 +0200	[thread overview]
Message-ID: <20260515091054.529610-1-arnd@kernel.org> (raw)

From: Arnd Bergmann <arnd@arndb.de>

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@arndb.de>
---
 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


                 reply	other threads:[~2026-05-15  9:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260515091054.529610-1-arnd@kernel.org \
    --to=arnd@kernel.org \
    --cc=airlied@gmail.com \
    --cc=airlied@redhat.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=arnd@arndb.de \
    --cc=bp@alien8.de \
    --cc=chris@chrisdown.name \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jglisse@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=simona@ffwll.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox