radesonsi: Remove unnecessary shader->selector NULL check.

shader->selector->info.stage == MESA_SHADER_COMPUTE at this case statement.

Fix defect reported by Coverity Scan.

Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking shader->selector suggests that it may
be null, but it has already been dereferenced on all paths leading to
the check.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7266>
This commit is contained in:
Vinson Lee 2020-10-21 16:32:55 -07:00
parent 5fb77a582a
commit e1736c7fdb
1 changed files with 1 additions and 2 deletions

View File

@ -990,8 +990,7 @@ static void si_calculate_max_simd_waves(struct si_shader *shader)
*/
lds_per_wave = conf->lds_size * lds_increment + align(num_inputs * 48, lds_increment);
break;
case MESA_SHADER_COMPUTE:
if (shader->selector) {
case MESA_SHADER_COMPUTE: {
unsigned max_workgroup_size = si_get_max_workgroup_size(shader);
lds_per_wave = (conf->lds_size * lds_increment) /
DIV_ROUND_UP(max_workgroup_size, sscreen->compute_wave_size);