Skip to contentSkip to conversation

drm/amdgpu: fix a warning in smu11 i2c code

PATCH In review Alex Deucher 2 participants 2 messages Aug 26, 2019 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: fix a warning in smu11 i2c code

make sure reg is initialized in smu_v11_0_i2c_set_clock_gating.

---
 drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c +1 -1
index 4cfcef0feff8..7d0d4c57b315 100644
@@ -50,7 +50,7 @@
 static void smu_v11_0_i2c_set_clock_gating(struct i2c_adapter *control, bool en)
 {
 	struct amdgpu_device *adev = to_amdgpu_device(control);
-	uint32_t reg;
+	uint32_t reg = RREG32_SOC15(SMUIO, 0, mmSMUIO_PWRMGT);
 
 	reg = REG_SET_FIELD(reg, SMUIO_PWRMGT, i2c_clk_gate_en, en ? 1 : 0);
 	WREG32_SOC15(SMUIO, 0, mmSMUIO_PWRMGT, reg);
Signature · 6 lines
2.20.1

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

A message that is not in the archive (sent off-list or not yet received): 20190826185453.1793-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org

Reviewed-by Andrey Grodzovsky
#2 lore raw

Hmm, my compiler didn't sent a warning about this...

Thanks.

Andrey

Quoted 12 lines · Alex Deucher

make sure reg is initialized in smu_v11_0_i2c_set_clock_gating.

---
  drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c +0 -0
index 4cfcef0feff8..7d0d4c57b315 100644

drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c line 56

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c +1 -1
@@ -50,7 +50,7 @@
  static void smu_v11_0_i2c_set_clock_gating(struct i2c_adapter *control, bool en)
  {
  	struct amdgpu_device *adev = to_amdgpu_device(control);
-	uint32_t reg;
+	uint32_t reg = RREG32_SOC15(SMUIO, 0, mmSMUIO_PWRMGT);
 
  	reg = REG_SET_FIELD(reg, SMUIO_PWRMGT, i2c_clk_gate_en, en ? 1 : 0);
  	WREG32_SOC15(SMUIO, 0, mmSMUIO_PWRMGT, reg);

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