Skip to contentSkip to conversation

drm/amd/pm: fix compile warning about missing prototype for function

PATCH In review Evan Quan 2 participants 3 messages Oct 28, 2020

Subsystems (3)
lore
Share & tools
lore

Evan Quan

author
#0 lore raw

PATCH 1/2 drm/amd/pm: fix compile warning about missing prototype for function

Fix the warning below:

Quoted 1 line
Quoted 1 line

drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:1234:29: warning: no previous prototype for function 'asic_internal_ss_get_ss_table' [-Wmissing-prototypes]

ATOM_ASIC_INTERNAL_SS_INFO *asic_internal_ss_get_ss_table(void *device)

                               ^

drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:1234:1: note: declare 'static' if the function is not intended to be used outside of this translation unit ATOM_ASIC_INTERNAL_SS_INFO *asic_internal_ss_get_ss_table(void *device)
^
static
1 warning generated.

Change-Id Ib4f252d0103fc10f7a89b495d9e0bfe8439b6c65
---
 drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c +1 -1
index 401b3b516db0..c2fee6796bd9 100644
@@ -1231,7 +1231,7 @@ uint32_t atomctrl_get_mpll_reference_clock(struct pp_hwmgr *hwmgr)
 /**
  * Get the asic internal spread spectrum table
  */
-ATOM_ASIC_INTERNAL_SS_INFO *asic_internal_ss_get_ss_table(void *device)
+static ATOM_ASIC_INTERNAL_SS_INFO *asic_internal_ss_get_ss_table(void *device)
 {
 	ATOM_ASIC_INTERNAL_SS_INFO *table = NULL;
 	u8 frev, crev;
Signature · 6 lines
2.29.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#1 lore raw

PATCH 2/2 drm/amd/pm: fix compile warnings about variable used uninitialized

Fix the compile warnings below:

Quoted 2 lines
Quoted 2 lines

drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:1743:13: warning: variable 'min' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:1743:13: warning: variable 'max' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]

Change-Id Id2dece80162cd10f004abbf3b62cba0c84e988f2
---
 drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c +2 -3
index 49db61a89505..5937150e6b37 100644
@@ -1856,7 +1856,7 @@ static int smu7_calculate_ro_range(struct pp_hwmgr *hwmgr)
 {
 	struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
 	struct amdgpu_device *adev = hwmgr->adev;
-	uint32_t asicrev1, evv_revision, max, min;
+	uint32_t asicrev1, evv_revision, max = 0, min = 0;
 
 	atomctrl_read_efuse(hwmgr, STRAP_EVV_REVISION_LSB, STRAP_EVV_REVISION_MSB,
 			&evv_revision);
@@ -1893,8 +1893,7 @@ static int smu7_calculate_ro_range(struct pp_hwmgr *hwmgr)
 				max = 2500;
 			}
 		}
-	} else if ((hwmgr->chip_id == CHIP_POLARIS11) ||
-		   (hwmgr->chip_id == CHIP_POLARIS12)) {
+	} else {
 		min = 1100;
 		max = 2100;
 	}
Signature · 6 lines
2.29.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
maintainer Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] drm/amd/pm: fix compile warnings about variable used uninitialized

[AMD Official Use Only - Internal Distribution Only]

Series is:

________________________________
From: Quan, Evan <[email protected]>
Sent: Tuesday, October 27, 2020 10:45 PM
To: [email protected] <[email protected]>
Cc: Deucher, Alexander <[email protected]>; Quan, Evan <[email protected]>; kernel test robot <[email protected]>
Subject: [PATCH 2/2] drm/amd/pm: fix compile warnings about variable used uninitialized

Fix the compile warnings below:

Quoted 2 lines
Quoted 2 lines

drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:1743:13: warning: variable 'min' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:1743:13: warning: variable 'max' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]

Change-Id Id2dece80162cd10f004abbf3b62cba0c84e988f2
---
 drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c +2 -3
index 49db61a89505..5937150e6b37 100644
@@ -1856,7 +1856,7 @@ static int smu7_calculate_ro_range(struct pp_hwmgr *hwmgr)
 {
         struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
         struct amdgpu_device *adev = hwmgr->adev;
-       uint32_t asicrev1, evv_revision, max, min;
+       uint32_t asicrev1, evv_revision, max = 0, min = 0;
 
         atomctrl_read_efuse(hwmgr, STRAP_EVV_REVISION_LSB, STRAP_EVV_REVISION_MSB,
                         &evv_revision);
@@ -1893,8 +1893,7 @@ static int smu7_calculate_ro_range(struct pp_hwmgr *hwmgr)
                                 max = 2500;
                         }
                 }
-       } else if ((hwmgr->chip_id == CHIP_POLARIS11) ||
-                  (hwmgr->chip_id == CHIP_POLARIS12)) {
+       } else {
                 min = 1100;
                 max = 2100;
         }

--
2.29.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx