Skip to content

Commit 9e5e22c

Browse files
listoutgregkh
authored andcommitted
drm/radeon/r600_cs: clean up of dead code in r600_cs
[ Upstream commit 260dcf5 ] 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 <[email protected]> Signed-off-by: Brahmajit Das <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 4d08d2a commit 9e5e22c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/radeon/r600_cs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,7 +1408,7 @@ static void r600_texture_size(unsigned nfaces, unsigned blevel, unsigned llevel,
14081408
unsigned block_align, unsigned height_align, unsigned base_align,
14091409
unsigned *l0_size, unsigned *mipmap_size)
14101410
{
1411-
unsigned offset, i, level;
1411+
unsigned offset, i;
14121412
unsigned width, height, depth, size;
14131413
unsigned blocksize;
14141414
unsigned nbx, nby;
@@ -1420,7 +1420,7 @@ static void r600_texture_size(unsigned nfaces, unsigned blevel, unsigned llevel,
14201420
w0 = r600_mip_minify(w0, 0);
14211421
h0 = r600_mip_minify(h0, 0);
14221422
d0 = r600_mip_minify(d0, 0);
1423-
for(i = 0, offset = 0, level = blevel; i < nlevels; i++, level++) {
1423+
for (i = 0, offset = 0; i < nlevels; i++) {
14241424
width = r600_mip_minify(w0, i);
14251425
nbx = r600_fmt_get_nblocksx(format, width);
14261426

0 commit comments

Comments
 (0)