Skip to contentSkip to conversation

drm/amd/powerplay: Fix missing break in switch

PATCH Applied Gustavo A. R. Silva 4 participants 5 messages Jan 25, 2019 – Jan 29, 2019

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

PATCH 1/1 drm/amd/powerplay: Fix missing break in switch

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

The resoning for this is that pclk_vol_table is an automatic variable. So, it makes no sense to update it just before falling through to the default case and return -EINVAL.

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

Fixes cd70f3d6e3fa ("drm/amd/powerplay: PP/DAL interface changes for dynamic clock switch")
---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +1 -0
index f95c5f50eb0f..5273de3c5b98 100644
@@ -1033,6 +1033,7 @@ static int smu10_get_clock_by_type_with_latency(struct pp_hwmgr *hwmgr,
 		break;
 	case amd_pp_dpp_clock:
 		pclk_vol_table = pinfo->vdd_dep_on_dppclk;
+		break;
 	default:
 		return -EINVAL;
 	}
Signature · 1 line
2.20.1
Applied
#1 lore raw
Quoted 8 lines · Gustavo A. R. Silva

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

The resoning for this is that pclk_vol_table is an automatic variable. So, it makes no sense to update it just before falling through to the default case and return -EINVAL.

Quoted 6 lines

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

Fixes cd70f3d6e3fa ("drm/amd/powerplay: PP/DAL interface changes for dynamic clock switch")

Applied. Thanks!

Alex

Quoted 19 lines
---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +1 -1
index f95c5f50eb0f..5273de3c5b98 100644
@@ -1033,6 +1033,7 @@ static int smu10_get_clock_by_type_with_latency(struct pp_hwmgr *hwmgr,
                break;
        case amd_pp_dpp_clock:
                pclk_vol_table = pinfo->vdd_dep_on_dppclk;
+               break;
        default:
                return -EINVAL;
        }
--

2.20.1

Quoted 4 lines

_______________________________________________
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

#2 lore raw
Quoted 10 lines · Alex Deucher
Quoted 8 lines · Gustavo A. R. Silva

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

The resoning for this is that pclk_vol_table is an automatic variable. So, it makes no sense to update it just before falling through to the default case and return -EINVAL.

Quoted 9 lines
Quoted 6 lines

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

Fixes cd70f3d6e3fa ("drm/amd/powerplay: PP/DAL interface changes for dynamic clock switch")

Applied. Thanks!

Great. :)

Thanks, Alex.
--
Gustavo

#3 lore raw
In reply to Gustavo A. R. Silva

Hi,

[This is an automated email]

This commit has been processed because it contains a "Fixes:" tag,
fixing commit: cd70f3d6e3fa drm/amd/powerplay: PP/DAL interface changes for dynamic clock switch.

The bot has tested the following trees: v4.20.5, v4.19.18, v4.14.96.

v4.20.5: Build OK!
v4.19.18: Build OK!
v4.14.96: Failed to apply! Possible dependencies:
Unable to calculate

How should we proceed with this patch?

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

#4 lore raw
In reply to Gustavo A. R. Silva

Hi,

[This is an automated email]

This commit has been processed because it contains a "Fixes:" tag,
fixing commit: cd70f3d6e3fa drm/amd/powerplay: PP/DAL interface changes for dynamic clock switch.

The bot has tested the following trees: v4.20.5, v4.19.18, v4.14.96.

v4.20.5: Build OK!
v4.19.18: Build OK!
v4.14.96: Failed to apply! Possible dependencies:
Unable to calculate

How should we proceed with this patch?

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