Skip to contentSkip to conversation

gpu: amd/pm: mark symbols static where possible for smu11

PATCH In review Jeff Pang 2 participants 3 messages Mar 2, 2023

Subsystems (3)
lore
Share & tools
lore

Jeff Pang

author
#0 lore raw

PATCH 1/1 gpu: amd/pm: mark symbols static where possible for smu11

I get one warning when building kernel with -Werror=missing-prototypes :

drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c:1600:5:
error: no previous prototype for ‘vangogh_set_apu_thermal_limit’ [-Werror=missing-prototypes]
int vangogh_set_apu_thermal_limit(struct smu_context *smu, uint32_t limit)

In fact, this function don't need a declaration due to it's only used in the file which they are.
So this patch marks the function with 'static'.

---
 drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +1 -1
index 016d5621e0b3..24046af60933 100644
@@ -1597,7 +1597,7 @@ static int vangogh_get_apu_thermal_limit(struct smu_context *smu, uint32_t *limi
 					      0, limit);
 }
 
-int vangogh_set_apu_thermal_limit(struct smu_context *smu, uint32_t limit)
+static int vangogh_set_apu_thermal_limit(struct smu_context *smu, uint32_t limit)
 {
 	return smu_cmn_send_smc_msg_with_param(smu,
 					      SMU_MSG_SetReducedThermalLimit,
Signature · 1 line
2.34.1
#1 lore raw

[AMD Official Use Only - General]

Thanks. But I think there was already a patch from Kun Liu to address this issue.
https://lists.freedesktop.org/archives/amd-gfx/2023-March/090029.html

BR
Evan

Quoted 45 lines

-----Original Message-----
From: Jeff Pang <[email protected]>
Sent: Thursday, March 2, 2023 5:16 PM
To: Quan, Evan <[email protected]>
Cc: [email protected]; [email protected]; dri- [email protected]; Jeff Pang <[email protected]>
Subject: [PATCH] gpu: amd/pm: mark symbols static where possible for smu11

I get one warning when building kernel with -Werror=missing-prototypes :

drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c:1600:5:
error: no previous prototype for ‘vangogh_set_apu_thermal_limit’ [-Werror=missing-prototypes]
int vangogh_set_apu_thermal_limit(struct smu_context *smu, uint32_t limit)

In fact, this function don't need a declaration due to it's only used in the file which they are.
So this patch marks the function with 'static'.

---
 drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0 -0
index 016d5621e0b3..24046af60933 100644
@@ -1597,7 +1597,7 @@ static int vangogh_get_apu_thermal_limit(struct

smu_context *smu, uint32_t *limi

drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0 -1
 					      0, limit);
 }
 
-int vangogh_set_apu_thermal_limit(struct smu_context *smu, uint32_t

limit)

drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +2 -0
+static int vangogh_set_apu_thermal_limit(struct smu_context *smu,
+uint32_t limit)
 {
 	return smu_cmn_send_smc_msg_with_param(smu,

SMU_MSG_SetReducedThermalLimit,
--
2.34.1