From: "Christian König" <christian.koenig@amd.com>
To: Brahmajit Das <listout@listout.xyz>
Cc: airlied@redhat.com, alexander.deucher@amd.com,
amd-gfx@lists.freedesktop.org, linux-next@vger.kernel.org
Subject: Re: [PATCH] drm/radeon/r600_cs: clean up of dead code in r600_cs
Date: Mon, 11 Aug 2025 14:17:52 +0200 [thread overview]
Message-ID: <a6da8462-e0c4-4bba-b65d-25ba3f5cdacc@amd.com> (raw)
In-Reply-To: <20250811092125.22630-1-listout@listout.xyz>
On 11.08.25 11:21, Brahmajit Das wrote:
> GCC 16 enables -Werror=unused-but-set-variable= which results in build
> error with the following message.
>
> drivers/gpu/drm/radeon/r600_cs.c: In function ‘r600_texture_size’:
> drivers/gpu/drm/radeon/r600_cs.c:1411:29: error: variable ‘level’ set but not used [-Werror=unused-but-set-variable=]
> 1411 | unsigned offset, i, level;
> | ^~~~~
> cc1: all warnings being treated as errors
> make[6]: *** [scripts/Makefile.build:287: drivers/gpu/drm/radeon/r600_cs.o] Error 1
>
> level although is set, but in never used in the function
> r600_texture_size. Thus resulting in dead code and this error getting
> triggered.
>
> Fixes: 60b212f8ddcdb ("drm/radeon: overhaul texture checking. (v3)")
> Signed-off-by: Brahmajit Das <listout@listout.xyz>
Acked-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/radeon/r600_cs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c
> index ac77d1246b94..811265648a58 100644
> --- a/drivers/gpu/drm/radeon/r600_cs.c
> +++ b/drivers/gpu/drm/radeon/r600_cs.c
> @@ -1408,7 +1408,7 @@ static void r600_texture_size(unsigned nfaces, unsigned blevel, unsigned llevel,
> unsigned block_align, unsigned height_align, unsigned base_align,
> unsigned *l0_size, unsigned *mipmap_size)
> {
> - unsigned offset, i, level;
> + unsigned offset, i;
> unsigned width, height, depth, size;
> unsigned blocksize;
> unsigned nbx, nby;
> @@ -1420,7 +1420,7 @@ static void r600_texture_size(unsigned nfaces, unsigned blevel, unsigned llevel,
> w0 = r600_mip_minify(w0, 0);
> h0 = r600_mip_minify(h0, 0);
> d0 = r600_mip_minify(d0, 0);
> - for(i = 0, offset = 0, level = blevel; i < nlevels; i++, level++) {
> + for (i = 0, offset = 0; i < nlevels; i++) {
> width = r600_mip_minify(w0, i);
> nbx = r600_fmt_get_nblocksx(format, width);
>
next prev parent reply other threads:[~2025-08-11 12:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-08 23:15 drm/radeon/r600_cs: Build failures with GCC 16 Brahmajit Das
2025-08-09 9:36 ` Brahmajit Das
2025-08-11 8:48 ` Christian König
2025-08-11 9:08 ` Brahmajit Das
2025-08-11 9:21 ` [PATCH] drm/radeon/r600_cs: clean up of dead code in r600_cs Brahmajit Das
2025-08-11 12:17 ` Christian König [this message]
2025-08-11 13:35 ` Alex Deucher
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=a6da8462-e0c4-4bba-b65d-25ba3f5cdacc@amd.com \
--to=christian.koenig@amd.com \
--cc=airlied@redhat.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=linux-next@vger.kernel.org \
--cc=listout@listout.xyz \
/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