Skip to contentSkip to conversation

drm/amdgpu/gfx10: fix mixed declaration and code warning

PATCH In review Alex Deucher 2 participants 2 messages Jul 21, 2021

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 drm/amdgpu/gfx10: fix mixed declaration and code warning

Move the declaration up to the top of the function.

Fixes 631d55e089eaa8 ("drm/amdgpu: Add error message when programing registers fails")
Cc Roy Sun <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +1 -1
index ca06fb137cac..d102cfd36ba2 100644
@@ -1493,6 +1493,7 @@ static u32 gfx_v10_rlcg_rw(struct amdgpu_device *adev, u32 offset, u32 v, uint32
 	uint32_t i = 0;
 	uint32_t retries = 50000;
 	u32 ret = 0;
+	u32 tmp;
 
 	scratch_reg0 = adev->rmmio +
 		       (adev->reg_offset[GC_HWIP][0][mmSCRATCH_REG0_BASE_IDX] + mmSCRATCH_REG0) * 4;
@@ -1526,7 +1527,6 @@ static u32 gfx_v10_rlcg_rw(struct amdgpu_device *adev, u32 offset, u32 v, uint32
 		writel(v, scratch_reg0);
 		writel(offset | flag, scratch_reg1);
 		writel(1, spare_int);
-		u32 tmp;
 
 		for (i = 0; i < retries; i++) {
 			tmp = readl(scratch_reg1);
Signature · 6 lines
2.31.1

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

Am 21.07.21 um 05:14 schrieb Alex Deucher:

Quoted 5 lines

Move the declaration up to the top of the function.

Fixes 631d55e089eaa8 ("drm/amdgpu: Add error message when programing registers fails")
Cc Roy Sun <[email protected]>
Quoted 17 lines
---
  drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +1 -0
index ca06fb137cac..d102cfd36ba2 100644
@@ -1493,6 +1493,7 @@ static u32 gfx_v10_rlcg_rw(struct amdgpu_device *adev, u32 offset, u32 v, uint32
  	uint32_t i = 0;
  	uint32_t retries = 50000;
  	u32 ret = 0;
+	u32 tmp;
 
  	scratch_reg0 = adev->rmmio +
  		       (adev->reg_offset[GC_HWIP][0][mmSCRATCH_REG0_BASE_IDX] + mmSCRATCH_REG0) * 4;

drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c static u32 gfx_v10_rlcg_rw(struct amdgpu_device *adev, u32 offset, u32 v, uint32 · line 1532

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +0 -1
@@ -1526,7 +1527,6 @@ static u32 gfx_v10_rlcg_rw(struct amdgpu_device *adev, u32 offset, u32 v, uint32
  		writel(v, scratch_reg0);
  		writel(offset | flag, scratch_reg1);
  		writel(1, spare_int);
-		u32 tmp;
 
  		for (i = 0; i < retries; i++) {
  			tmp = readl(scratch_reg1);

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