Skip to contentSkip to conversation

drm/amdgpu/powerplay: Fix missing break in switch statement

PATCH In review Gustavo A. R. Silva 3 participants 4 messages Mar 1, 2019 – Mar 4, 2019

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

PATCH 1/1 drm/amdgpu/powerplay: Fix missing break in switch statement

Add missing break statement in order to prevent the code from falling through to case SMU_Discrete_DpmTable.

This bug was found thanks to the ongoing efforts to enable -Wimplicit-fallthrough.

Fixes 34a564eaf528 ("drm/amd/powerplay: implement fw image related smum interface for Polaris.")
---
 drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c +1 -0
index 52abca065764..222fb79d319e 100644
@@ -2330,6 +2330,7 @@ static uint32_t polaris10_get_offsetof(uint32_t type, uint32_t member)
 		case DRAM_LOG_BUFF_SIZE:
 			return offsetof(SMU74_SoftRegisters, DRAM_LOG_BUFF_SIZE);
 		}
+		break;
 	case SMU_Discrete_DpmTable:
 		switch (member) {
 		case UvdBootLevel:
Signature · 1 line
2.21.0
#1 lore raw
Quoted 10 lines · Gustavo A. R. Silva

Add missing break statement in order to prevent the code from falling through to case SMU_Discrete_DpmTable.

This bug was found thanks to the ongoing efforts to enable -Wimplicit-fallthrough.

Fixes 34a564eaf528 ("drm/amd/powerplay: implement fw image related smum interface for Polaris.")

Already fixed:
https://cgit.freedesktop.org/~agd5f/linux/commit/?h=drm-next-5.2-wip&id=6feaa4194c18578623565017f95d1b2f6b243567

Alex

Quoted 19 lines
---
 drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c +1 -1
index 52abca065764..222fb79d319e 100644
@@ -2330,6 +2330,7 @@ static uint32_t polaris10_get_offsetof(uint32_t type, uint32_t member)
                case DRAM_LOG_BUFF_SIZE:
                        return offsetof(SMU74_SoftRegisters, DRAM_LOG_BUFF_SIZE);
                }
+               break;
        case SMU_Discrete_DpmTable:
                switch (member) {
                case UvdBootLevel:
--

2.21.0

Quoted 4 lines

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

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

#2 lore raw
Quoted 9 lines · Alex Deucher
Quoted 7 lines · Gustavo A. R. Silva

Add missing break statement in order to prevent the code from falling through to case SMU_Discrete_DpmTable.

This bug was found thanks to the ongoing efforts to enable -Wimplicit-fallthrough.

Quoted 7 lines
Quoted 3 lines
Fixes 34a564eaf528 ("drm/amd/powerplay: implement fw image related smum interface for Polaris.")

Already fixed:
https://cgit.freedesktop.org/~agd5f/linux/commit/?h=drm-next-5.2-wip&id=6feaa4194c18578623565017f95d1b2f6b243567

Awesome. :)

I was looking for that link, but I didn't find it. That's why I sent this patch.

Happy to see it is fixed now.

Thanks, Alex.

--
Gustavo

Reviewed-by on v1 1/1
#3 lore raw
In reply to Gustavo A. R. Silva
Quoted 9 lines · Gustavo A. R. Silva

Add missing break statement in order to prevent the code from falling through to case SMU_Discrete_DpmTable.

This bug was found thanks to the ongoing efforts to enable -Wimplicit-fallthrough.

Fixes 34a564eaf528 ("drm/amd/powerplay: implement fw image related smum interface for Polaris.")
Quoted 23 lines
---
 drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c +1 -0
index 52abca065764..222fb79d319e 100644
@@ -2330,6 +2330,7 @@ static uint32_t polaris10_get_offsetof(uint32_t type, uint32_t member)
 		case DRAM_LOG_BUFF_SIZE:
 			return offsetof(SMU74_SoftRegisters, DRAM_LOG_BUFF_SIZE);
 		}
+		break;
 	case SMU_Discrete_DpmTable:
 		switch (member) {
 		case UvdBootLevel:
Signature · 6 lines
2.21.0

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