linux-6.15-rc6/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c: possible cut'n'paste error ?

David Binderman dcb314 at hotmail.com
Fri May 16 08:21:54 UTC 2025


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


More information about the dri-devel mailing list