Skip to contentSkip to conversation

drm/amd/powerplay: Fix code error for translating int type to bool type correctly

PATCH In review Chengming Gui 2 participants 2 messages May 21, 2019 – May 22, 2019 1 message not in the archive

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

PATCH 1/1 drm/amd/powerplay: Fix code error for translating int type to bool type correctly

Fix code error to support value < 0 or > 1.

---
 drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +1 -1
index 3a47130..d5f03b9 100644
@@ -348,7 +348,7 @@ static int smu_early_init(void *handle)
 	struct smu_context *smu = &adev->smu;
 
 	smu->adev = adev;
-	smu->pm_enabled = amdgpu_dpm;
+	smu->pm_enabled = !!amdgpu_dpm;
 	mutex_init(&smu->mutex);
 
 	return smu_set_funcs(adev);
Signature · 6 lines
2.7.4

_______________________________________________
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): 1558439172-4802-1-git-send-email-Jack.Gui-5C7GfCeVMHo@public.gmane.org

Reviewed-by Hawking Zhang
#2 lore raw

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Chengming Gui
Sent: 2019年5月21日 19:46
To: [email protected]
Cc: Gui, Jack <[email protected]>
Subject: [PATCH] drm/amd/powerplay: Fix code error for translating int type to bool type correctly

[CAUTION: External Email]

Fix code error to support value < 0 or > 1.

---
 drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +1 -1
index 3a47130..d5f03b9 100644
@@ -348,7 +348,7 @@ static int smu_early_init(void *handle)
        struct smu_context *smu = &adev->smu;
 
        smu->adev = adev;
-       smu->pm_enabled = amdgpu_dpm;
+       smu->pm_enabled = !!amdgpu_dpm;
        mutex_init(&smu->mutex);
 
        return smu_set_funcs(adev);

--
2.7.4

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