Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: Remove redundant assignments

[WHAT & HOW]
log2_blk_height and log2_blk_width are assigned to 0 and then
immediately are updated to other values. The assignments to zero are
redudant and removed.

This fixes 18 UNUSED_VALUE issues reported by Coverity.

Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Alex Hung and committed by
Alex Deucher
bcb4a5c6 b9c8ad73

-24
-4
drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20.c
··· 443 443 blk_bytes = surf_linear ? 444 444 256 : get_blk_size_bytes((enum source_macro_tile_size) macro_tile_size); 445 445 log2_blk_bytes = dml_log2((double) blk_bytes); 446 - log2_blk_height = 0; 447 - log2_blk_width = 0; 448 446 449 447 // remember log rule 450 448 // "+" in log is multiply ··· 489 491 - log2_meta_req_height; 490 492 meta_req_width = 1 << log2_meta_req_width; 491 493 meta_req_height = 1 << log2_meta_req_height; 492 - log2_meta_row_height = 0; 493 - meta_row_width_ub = 0; 494 494 495 495 // the dimensions of a meta row are meta_row_width x meta_row_height in elements. 496 496 // calculate upper bound of the meta_row_width
-4
drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20v2.c
··· 443 443 blk_bytes = surf_linear ? 444 444 256 : get_blk_size_bytes((enum source_macro_tile_size) macro_tile_size); 445 445 log2_blk_bytes = dml_log2((double) blk_bytes); 446 - log2_blk_height = 0; 447 - log2_blk_width = 0; 448 446 449 447 // remember log rule 450 448 // "+" in log is multiply ··· 489 491 - log2_meta_req_height; 490 492 meta_req_width = 1 << log2_meta_req_width; 491 493 meta_req_height = 1 << log2_meta_req_height; 492 - log2_meta_row_height = 0; 493 - meta_row_width_ub = 0; 494 494 495 495 // the dimensions of a meta row are meta_row_width x meta_row_height in elements. 496 496 // calculate upper bound of the meta_row_width
-4
drivers/gpu/drm/amd/display/dc/dml/dcn21/display_rq_dlg_calc_21.c
··· 435 435 blk_bytes = surf_linear ? 436 436 256 : get_blk_size_bytes((enum source_macro_tile_size) macro_tile_size); 437 437 log2_blk_bytes = dml_log2((double) blk_bytes); 438 - log2_blk_height = 0; 439 - log2_blk_width = 0; 440 438 441 439 // remember log rule 442 440 // "+" in log is multiply ··· 483 485 - log2_meta_req_height; 484 486 meta_req_width = 1 << log2_meta_req_width; 485 487 meta_req_height = 1 << log2_meta_req_height; 486 - log2_meta_row_height = 0; 487 - meta_row_width_ub = 0; 488 488 489 489 // the dimensions of a meta row are meta_row_width x meta_row_height in elements. 490 490 // calculate upper bound of the meta_row_width
-4
drivers/gpu/drm/amd/display/dc/dml/dcn30/display_rq_dlg_calc_30.c
··· 392 392 blk_bytes = surf_linear ? 393 393 256 : get_blk_size_bytes((enum source_macro_tile_size) macro_tile_size); 394 394 log2_blk_bytes = dml_log2((double)blk_bytes); 395 - log2_blk_height = 0; 396 - log2_blk_width = 0; 397 395 398 396 // remember log rule 399 397 // "+" in log is multiply ··· 462 464 - log2_meta_req_height; 463 465 meta_req_width = 1 << log2_meta_req_width; 464 466 meta_req_height = 1 << log2_meta_req_height; 465 - log2_meta_row_height = 0; 466 - meta_row_width_ub = 0; 467 467 468 468 // the dimensions of a meta row are meta_row_width x meta_row_height in elements. 469 469 // calculate upper bound of the meta_row_width
-4
drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c
··· 413 413 log2_blk256_height = dml_log2((double) blk256_height); 414 414 blk_bytes = surf_linear ? 256 : get_blk_size_bytes((enum source_macro_tile_size) macro_tile_size); 415 415 log2_blk_bytes = dml_log2((double) blk_bytes); 416 - log2_blk_height = 0; 417 - log2_blk_width = 0; 418 416 419 417 // remember log rule 420 418 // "+" in log is multiply ··· 479 481 log2_meta_req_width = log2_meta_req_bytes + 8 - log2_bytes_per_element - log2_meta_req_height; 480 482 meta_req_width = 1 << log2_meta_req_width; 481 483 meta_req_height = 1 << log2_meta_req_height; 482 - log2_meta_row_height = 0; 483 - meta_row_width_ub = 0; 484 484 485 485 // the dimensions of a meta row are meta_row_width x meta_row_height in elements. 486 486 // calculate upper bound of the meta_row_width
-4
drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c
··· 501 501 log2_blk256_height = dml_log2((double) blk256_height); 502 502 blk_bytes = surf_linear ? 256 : get_blk_size_bytes((enum source_macro_tile_size) macro_tile_size); 503 503 log2_blk_bytes = dml_log2((double) blk_bytes); 504 - log2_blk_height = 0; 505 - log2_blk_width = 0; 506 504 507 505 // remember log rule 508 506 // "+" in log is multiply ··· 567 569 log2_meta_req_width = log2_meta_req_bytes + 8 - log2_bytes_per_element - log2_meta_req_height; 568 570 meta_req_width = 1 << log2_meta_req_width; 569 571 meta_req_height = 1 << log2_meta_req_height; 570 - log2_meta_row_height = 0; 571 - meta_row_width_ub = 0; 572 572 573 573 // the dimensions of a meta row are meta_row_width x meta_row_height in elements. 574 574 // calculate upper bound of the meta_row_width