1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/gpu/drm/amd/display
Nathan Chancellor d7643fe6fb drm/amd/display: Avoid enum conversion warning
Clang warns (or errors with CONFIG_WERROR=y) when performing arithmetic
with different enumerated types, which is usually a bug:

    drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_dp_dpia_bw.c:548:24: error: arithmetic between different enumeration types ('const enum dc_link_rate' and 'const enum dc_lane_count') [-Werror,-Wenum-enum-conversion]
      548 |                         link_cap->link_rate * link_cap->lane_count * LINK_RATE_REF_FREQ_IN_KHZ * 8;
          |                         ~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~
    1 error generated.

In this case, there is not a problem because the enumerated types are
basically treated as '#define' values. Add an explicit cast to an
integral type to silence the warning.

Closes: https://github.com/ClangBuiltLinux/linux/issues/1976
Fixes: 5f3bce1326 ("drm/amd/display: Request usb4 bw for mst streams")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2024-01-15 18:35:07 -05:00
..
amdgpu_dm drm/amd/display: cleanup inconsistent indenting in amdgpu_dm_color 2024-01-09 15:44:13 -05:00
dc drm/amd/display: Avoid enum conversion warning 2024-01-15 18:35:07 -05:00
dmub drm/amd/display: [FW Promotion] Release 0.0.197.0 2023-12-19 14:59:03 -05:00
include drm/amd/display: To adjust dprefclk by down spread percentage 2024-01-09 15:43:53 -05:00
modules drm/amd/display: Fix power_helpers.c codestyle 2024-01-05 16:10:44 -05:00
Kconfig drm/amd/display: Allow building DC with clang on RISC-V 2023-07-21 16:52:25 -04:00
Makefile drm/amd/display: Refactor OPTC into component folder 2023-11-29 16:49:01 -05:00
TODO