drm/amdgpu/pm: mark pcie link/speed arrays as const
Subsystems (3)
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu/pm: mark pcie link/speed arrays as const
They are read only.
Noticed-by Dave Airlie <[email protected]>
Signed-off-by Alex Deucher <[email protected]>
--- drivers/gpu/drm/amd/pm/inc/smu_v11_0.h | 4 ++-- drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c | 4 ++-- drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c | 4 ++-- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/pm/inc/smu_v11_0.h +2 -2
@@ -61,8 +61,8 @@#define LINK_WIDTH_MAX 6#define LINK_SPEED_MAX 3 -static __maybe_unused uint16_t link_width[] = {0 ,1 ,2 ,4 ,8 ,12 ,16 }; -static __maybe_unused uint16_t link_speed[] = {25 ,50 ,80 ,160 }; +static const __maybe_unused uint16_t link_width[] = {0 ,1 ,2 ,4 ,8 ,12 ,16 }; +static const __maybe_unused uint16_t link_speed[] = {25 ,50 ,80 ,160 };static const struct smu_temperature_range __maybe_unused smu11_thermal_policy[] =
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c +2 -2
@@ -52,8 +52,8 @@#define LINK_WIDTH_MAX 6#define LINK_SPEED_MAX 3 -static int link_width[] = {0 ,1 ,2 ,4 ,8 ,12 ,16 }; -static int link_speed[] = {25 ,50 ,80 ,160 }; +static const int link_width[] = {0 ,1 ,2 ,4 ,8 ,12 ,16 }; +static const int link_speed[] = {25 ,50 ,80 ,160 };static int vega12_force_clock_level (struct pp_hwmgr *hwmgr,enum pp_clock_type type,uint32_t mask);
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c +2 -2
@@ -57,8 +57,8 @@#define LINK_WIDTH_MAX 6#define LINK_SPEED_MAX 3 -static int link_width[] = {0 ,1 ,2 ,4 ,8 ,12 ,16 }; -static int link_speed[] = {25 ,50 ,80 ,160 }; +static const int link_width[] = {0 ,1 ,2 ,4 ,8 ,12 ,16 }; +static const int link_speed[] = {25 ,50 ,80 ,160 };static void vega20_set_default_registry_data (struct pp_hwmgr *hwmgr) {
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +2 -2
@@ -72,8 +72,8 @@ MODULE_FIRMWARE("amdgpu/aldebaran_smc.bin");#define PCIE_LC_SPEED_CNTL__LC_CURRENT_DATA_RATE_MASK 0xC000#define PCIE_LC_SPEED_CNTL__LC_CURRENT_DATA_RATE__SHIFT 0xE -static int link_width[] = {0 ,1 ,2 ,4 ,8 ,12 ,16 }; -static int link_speed[] = {25 ,50 ,80 ,160 }; +static const int link_width[] = {0 ,1 ,2 ,4 ,8 ,12 ,16 }; +static const int link_speed[] = {25 ,50 ,80 ,160 };int smu_v13_0_init_microcode (struct smu_context *smu) {
Signature · 6 lines
2.30.2 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[AMD Public Use]
Reviewed-by Evan Quan <[email protected]>
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Wednesday, March 24, 2021 11:51 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Dave Airlie <[email protected]>
Subject: [PATCH] drm/amdgpu/pm: mark pcie link/speed arrays as const
They are read only.
Noticed-by Dave Airlie <[email protected]>
Signed-off-by Alex Deucher <[email protected]>
--- drivers/gpu/drm/amd/pm/inc/smu_v11_0.h | 4 ++-- drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c | 4 ++-- drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c | 4 ++-- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/pm/inc/smu_v11_0.h +2 -2
@@ -61,8 +61,8 @@#define LINK_WIDTH_MAX 6#define LINK_SPEED_MAX 3 -static __maybe_unused uint16_t link_width[] = {0 ,1 ,2 ,4 ,8 ,12 ,16 }; -static __maybe_unused uint16_t link_speed[] = {25 ,50 ,80 ,160 }; +static const __maybe_unused uint16_t link_width[] = {0 ,1 ,2 ,4 ,8 ,12 ,16 }; +static const __maybe_unused uint16_t link_speed[] = {25 ,50 ,80 ,160 };static const struct smu_temperature_range __maybe_unused smu11_thermal_policy[] =
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c +2 -2
@@ -52,8 +52,8 @@#define LINK_WIDTH_MAX 6#define LINK_SPEED_MAX 3 -static int link_width[] = {0 ,1 ,2 ,4 ,8 ,12 ,16 }; -static int link_speed[] = {25 ,50 ,80 ,160 }; +static const int link_width[] = {0 ,1 ,2 ,4 ,8 ,12 ,16 }; +static const int link_speed[] = {25 ,50 ,80 ,160 };static int vega12_force_clock_level (struct pp_hwmgr *hwmgr,enum pp_clock_type type,uint32_t mask);
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c +2 -2
@@ -57,8 +57,8 @@#define LINK_WIDTH_MAX 6#define LINK_SPEED_MAX 3 -static int link_width[] = {0 ,1 ,2 ,4 ,8 ,12 ,16 }; -static int link_speed[] = {25 ,50 ,80 ,160 }; +static const int link_width[] = {0 ,1 ,2 ,4 ,8 ,12 ,16 }; +static const int link_speed[] = {25 ,50 ,80 ,160 };static void vega20_set_default_registry_data (struct pp_hwmgr *hwmgr) {
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +2 -2
@@ -72,8 +72,8 @@ MODULE_FIRMWARE("amdgpu/aldebaran_smc.bin");#define PCIE_LC_SPEED_CNTL__LC_CURRENT_DATA_RATE_MASK 0xC000#define PCIE_LC_SPEED_CNTL__LC_CURRENT_DATA_RATE__SHIFT 0xE -static int link_width[] = {0 ,1 ,2 ,4 ,8 ,12 ,16 }; -static int link_speed[] = {25 ,50 ,80 ,160 }; +static const int link_width[] = {0 ,1 ,2 ,4 ,8 ,12 ,16 }; +static const int link_speed[] = {25 ,50 ,80 ,160 };int smu_v13_0_init_microcode (struct smu_context *smu) {
Signature · 10 lines
2.30.2 _______________________________________________ amd-gfx mailing list [email protected] https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Cevan.quan%40amd.com%7Ce8555780c9d14e661a8408d8ee780db6%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637521546688653644%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=tApsvru3cpPITKneQDeH%2B4XBks8ZF43fCCWJ3MjQxHE%3D&reserved=0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx