Skip to content

Commit 2edb921

Browse files
listoutUlrich Hecht
authored andcommitted
drm/radeon/r600_cs: clean up of dead code in r600_cs
[ Upstream commit 260dcf5b06d519bcf27a5dfdb5c626821a55c170 ] 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: 60b212f ("drm/radeon: overhaul texture checking. (v3)") Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Brahmajit Das <listout@listout.xyz> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Ulrich Hecht <uli@kernel.org>
1 parent 41c281a commit 2edb921

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/gpu/drm/radeon/r600_cs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,7 +1411,7 @@ static void r600_texture_size(unsigned nfaces, unsigned blevel, unsigned llevel,
14111411
unsigned block_align, unsigned height_align, unsigned base_align,
14121412
unsigned *l0_size, unsigned *mipmap_size)
14131413
{
1414-
unsigned offset, i, level;
1414+
unsigned offset, i;
14151415
unsigned width, height, depth, size;
14161416
unsigned blocksize;
14171417
unsigned nbx, nby;
@@ -1423,7 +1423,7 @@ static void r600_texture_size(unsigned nfaces, unsigned blevel, unsigned llevel,
14231423
w0 = r600_mip_minify(w0, 0);
14241424
h0 = r600_mip_minify(h0, 0);
14251425
d0 = r600_mip_minify(d0, 0);
1426-
for(i = 0, offset = 0, level = blevel; i < nlevels; i++, level++) {
1426+
for (i = 0, offset = 0; i < nlevels; i++) {
14271427
width = r600_mip_minify(w0, i);
14281428
nbx = r600_fmt_get_nblocksx(format, width);
14291429

0 commit comments

Comments
 (0)