Skip to contentSkip to conversation

drm/amd/powerplay: fix amd_powerplay_reset()

PATCH Applied Dan Carpenter 4 participants 4 messages Oct 24, 2017 – Oct 25, 2017

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

PATCH 1/1 drm/amd/powerplay: fix amd_powerplay_reset()

We accidentally inverted an if statement and turned amd_powerplay_reset() into a no-op.

Fixes ae97988fc89e ("drm/amd/powerplay: tidy up ret checks in amd_powerplay.c (v3)")

---
IMHO, tidying unreadable double negatives is tricky and error prone but still worth it in the long run.

drivers/gpu/drm/amd/powerplay/amd_powerplay.c +1 -1
index 3c8ef4bfc205..0f8b6dc853a5 100644
@@ -1184,7 +1184,7 @@ int amd_powerplay_reset(void *handle)
 	int ret;
 
 	ret = pp_check(instance);
-	if (!ret)
+	if (ret)
 		return ret;
 
 	ret = pp_hw_fini(instance);

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

#1 lore raw
Quoted 4 lines · Dan Carpenter

We accidentally inverted an if statement and turned amd_powerplay_reset() into a no-op.

Fixes ae97988fc89e ("drm/amd/powerplay: tidy up ret checks in amd_powerplay.c (v3)")

For some reason I looked up that commit, and it has *two* cases where "ret != 0" gets changed to "!ret".

BR,
Jani.

Quoted 22 lines

---
IMHO, tidying unreadable double negatives is tricky and error prone but still worth it in the long run.

drivers/gpu/drm/amd/powerplay/amd_powerplay.c +1 -1
index 3c8ef4bfc205..0f8b6dc853a5 100644
@@ -1184,7 +1184,7 @@ int amd_powerplay_reset(void *handle)
 	int ret;
 
 	ret = pp_check(instance);
-	if (!ret)
+	if (ret)
 		return ret;
 
 	ret = pp_hw_fini(instance);

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

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw
Quoted 9 lines · Jani Nikula
Quoted 4 lines · Dan Carpenter

We accidentally inverted an if statement and turned amd_powerplay_reset() into a no-op.

Fixes ae97988fc89e ("drm/amd/powerplay: tidy up ret checks in amd_powerplay.c (v3)")

For some reason I looked up that commit, and it has *two* cases where "ret != 0" gets changed to "!ret".

The other bug was secretly fixed in commit 3811f8f00c5f ("drm/amd/powerplay:
move set_clockgating_by_smu to pp func table").

regards,
dan carpenter

Applied
#3 lore raw
In reply to Dan Carpenter
Quoted 5 lines · Dan Carpenter

We accidentally inverted an if statement and turned amd_powerplay_reset() into a no-op.

Fixes ae97988fc89e ("drm/amd/powerplay: tidy up ret checks in amd_powerplay.c (v3)")

Applied. thanks!

Alex

Quoted 17 lines

---
IMHO, tidying unreadable double negatives is tricky and error prone but still worth it in the long run.

drivers/gpu/drm/amd/powerplay/amd_powerplay.c +1 -1
index 3c8ef4bfc205..0f8b6dc853a5 100644
@@ -1184,7 +1184,7 @@ int amd_powerplay_reset(void *handle)
        int ret;
 
        ret = pp_check(instance);
-       if (!ret)
+       if (ret)
                return ret;
 
        ret = pp_hw_fini(instance);
Quoted 4 lines

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

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