drm/amdgpu: fix overflowed constant warning in mmhub_set_clockgating()
authorBob Zhou <bob.zhou@amd.com>
Fri, 7 Jun 2024 08:33:35 +0000 (16:33 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 14 Jun 2024 20:17:12 +0000 (16:17 -0400)
To fix potential overflowed constant warning, modify the variables to u32
for getting the return value of RREG32_SOC15().

Signed-off-by: Bob Zhou <bob.zhou@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/mmhub_v1_7.c
drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c
drivers/gpu/drm/amd/amdgpu/mmhub_v3_3.c
drivers/gpu/drm/amd/amdgpu/mmhub_v9_4.c

index 92432cd..9689e2b 100644 (file)
@@ -544,7 +544,7 @@ static int mmhub_v1_7_set_clockgating(struct amdgpu_device *adev,
 
 static void mmhub_v1_7_get_clockgating(struct amdgpu_device *adev, u64 *flags)
 {
-       int data, data1;
+       u32 data, data1;
 
        if (amdgpu_sriov_vf(adev))
                *flags = 0;
index 02fd452..a0cc8e2 100644 (file)
@@ -671,7 +671,7 @@ static int mmhub_v2_0_set_clockgating(struct amdgpu_device *adev,
 
 static void mmhub_v2_0_get_clockgating(struct amdgpu_device *adev, u64 *flags)
 {
-       int data, data1;
+       u32 data, data1;
 
        if (amdgpu_sriov_vf(adev))
                *flags = 0;
index 8928f91..b4ce337 100644 (file)
@@ -613,7 +613,7 @@ static int mmhub_v3_3_set_clockgating(struct amdgpu_device *adev,
 
 static void mmhub_v3_3_get_clockgating(struct amdgpu_device *adev, u64 *flags)
 {
-       int data;
+       u32 data;
 
        if (amdgpu_sriov_vf(adev))
                *flags = 0;
index 1b7da4a..ff1b58e 100644 (file)
@@ -657,7 +657,7 @@ static int mmhub_v9_4_set_clockgating(struct amdgpu_device *adev,
 
 static void mmhub_v9_4_get_clockgating(struct amdgpu_device *adev, u64 *flags)
 {
-       int data, data1;
+       u32 data, data1;
 
        if (amdgpu_sriov_vf(adev))
                *flags = 0;