Skip to contentSkip to conversation

drm/amdgpu: fix warning

PATCH In review Alex Deucher 3 participants 5 messages Jan 10, 2022 – Jan 11, 2022

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/3 drm/amdgpu: fix warning

warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]

Fixes 8c50db2f64ee ("drm/amdgpu: Adjust error inject function code style in amdgpu_ras.c")
Cc yipechai <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +1 -1
index aa8d614009d4..478457637d29 100644
@@ -949,7 +949,7 @@ static void amdgpu_xgmi_query_ras_error_count(struct amdgpu_device *adev,
 /* Trigger XGMI/WAFL error */
 static int amdgpu_ras_error_inject_xgmi(struct amdgpu_device *adev,  void *inject_if)
 {
-	int ret = 0;;
+	int ret = 0;
 	struct ta_ras_trigger_error_input *block_info =  (struct ta_ras_trigger_error_input *)inject_if;
 
 	if (amdgpu_dpm_set_df_cstate(adev, DF_CSTATE_DISALLOW))
Signature · 1 line
2.33.1
author maintainer
#1 lore raw

PATCH 2/3 drm/amdgpu: add a forward declaration for struct amdgpu_iv_entry

To prevent:
warning: ‘struct amdgpu_iv_entry’ declared inside parameter list will not be visible outside of this definition or declaration

Fixes 0f60e1036d85 ("drm/amdgpu: Modify the compilation failed problem when other ras blocks' .h include amdgpu_ras.h")
Cc yipechai <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h +2 -0
index f604a2235a9c..7a4d82378205 100644
@@ -29,6 +29,8 @@
 #include "ta_ras_if.h"
 #include "amdgpu_ras_eeprom.h"
 
+struct amdgpu_iv_entry;
+
 #define AMDGPU_RAS_FLAG_INIT_BY_VBIOS		(0x1 << 0)
 
 enum amdgpu_ras_block {
Signature · 1 line
2.33.1
author maintainer
#2 lore raw

PATCH 3/3 drm/amdgpu: remove unused variable

In reply to Alex Deucher

No longer used. remove it.

Fixes 36324c09d848 ("drm/amdgpu: Modify sdma block to fit for the unified ras block data and ops")
Cc yipechai <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0 -1
index b1bedfd4febc..517650d286a7 100644
@@ -942,7 +942,6 @@ int amdgpu_ras_query_error_status(struct amdgpu_device *adev,
 	struct amdgpu_ras_block_object* block_obj = NULL;
 	struct ras_manager *obj = amdgpu_ras_find_obj(adev, &info->head);
 	struct ras_err_data err_data = {0, 0, 0, NULL};
-	int i;
 
 	if (!obj)
 		return -EINVAL;
Signature · 1 line
2.33.1
Reviewed-by on v1 1/3
#3 lore raw
In reply to Alex Deucher

[AMD Official Use Only]

Thanks! The series is:

Quoted 38 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Tuesday, January 11, 2022 4:19 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Chai, Thomas <[email protected]>
Subject: [PATCH 1/3] drm/amdgpu: fix warning

warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after- statement]

Fixes 8c50db2f64ee ("drm/amdgpu: Adjust error inject function code style in

amdgpu_ras.c")

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +1 -1
index aa8d614009d4..478457637d29 100644
@@ -949,7 +949,7 @@ static void amdgpu_xgmi_query_ras_error_count(struct
 amdgpu_device *adev,
 /* Trigger XGMI/WAFL error */
 static int amdgpu_ras_error_inject_xgmi(struct amdgpu_device *adev,  void
 *inject_if)  {
-	int ret = 0;;
+	int ret = 0;
 	struct ta_ras_trigger_error_input *block_info =  (struct
 ta_ras_trigger_error_input *)inject_if;

if (amdgpu_dpm_set_df_cstate(adev, DF_CSTATE_DISALLOW))
--
2.33.1

Tested-by Rodrigo Siqueira on v1 1/3
#4 lore raw
In reply to Alex Deucher
Quoted 15 lines · Alex Deucher

warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]

Fixes 8c50db2f64ee ("drm/amdgpu: Adjust error inject function code style in amdgpu_ras.c")
Cc yipechai <[email protected]>
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +0 -0
index aa8d614009d4..478457637d29 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c static void amdgpu_xgmi_query_ras_error_count(struct amdgpu_device *adev, · line 955

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +1 -1
@@ -949,7 +949,7 @@ static void amdgpu_xgmi_query_ras_error_count(struct amdgpu_device *adev,
  /* Trigger XGMI/WAFL error */
  static int amdgpu_ras_error_inject_xgmi(struct amdgpu_device *adev,  void *inject_if)
  {
-	int ret = 0;;
+	int ret = 0;
  	struct ta_ras_trigger_error_input *block_info =  (struct ta_ras_trigger_error_input *)inject_if;
 
  	if (amdgpu_dpm_set_df_cstate(adev, DF_CSTATE_DISALLOW))

Hi Alex,

This entire series is:

Thanks.