linux-6.15-rc6/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c: possible cut'n'paste error ?
From: David Binderman
Date: Fri May 16 2025 - 04:23:13 EST
Hello there,
Static analyser cppcheck says:
linux-6.15-rc6/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c:595:45: style: Variable 'p->out_states->state_array[i].dtbclk_mhz' is reassigned a value before the old one has been used. [redundantAssignment]
linux-6.15-rc6/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c:594:45: style: Variable 'p->out_states->state_array[i].phyclk_mhz' is reassigned a value before the old one has been used. [redundantAssignment]
Source code is
p->out_states->state_array[i].dppclk_mhz = max_dppclk_mhz;
p->out_states->state_array[i].dtbclk_mhz = max_dtbclk_mhz;
p->out_states->state_array[i].phyclk_mhz = max_phyclk_mhz;
p->out_states->state_array[i].dscclk_mhz = max_dispclk_mhz / 3.0;
p->out_states->state_array[i].phyclk_mhz = max_phyclk_mhz;
p->out_states->state_array[i].dtbclk_mhz = max_dtbclk_mhz;
Suggest code rework.
Regards
David Binderman