linux-next: build warning after merge of the amdgpu tree
Subsystems (3)
Hi all,
After merging the amdgpu tree, today's linux-next build (powerpc allyesconfig) produced this warning:
In file included from include/linux/compiler_types.h:59,
from <command-line>:drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c: In function 'smu7_request_link_speed_change_before_state_change':include/linux/compiler_attributes.h:200:41: warning: statement will never be executed [-Wswitch-unreachable]
200 | # define fallthrough __attribute__((__fallthrough__))
| ^~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c:3706:4: note: in expansion of macro 'fallthrough'
3706 | fallthrough;
| ^~~~~~~~~~~Introduced by commit
e86efa063cd1 ("AMD POWERPLAY: Use fallthrough;")
Signature · 2 lines
Cheers, Stephen Rothwell
PATCH 1/1 drm/amd/powerplay: Move fallthrough; into containing #ifdef/#endif
The automated conversion of /* fallthrough */ comments converted a comment outside of an #ifdef/#endif case block that should be inside the block.
Move the fallthrough inside the block to silence the warning.
---
Quoted 15 lines · Stephen Rothwell
Hi all,
After merging the amdgpu tree, today's linux-next build (powerpc allyesconfig) produced this warning:
In file included from
include/linux/compiler_types.h:59,
from <command-line>:drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c: In function 'smu7_request_link_speed_change_before_state_change':include/linux/compiler_attributes.h:200:41: warning: statement will never be executed [-Wswitch-unreachable]200 | # define fallthrough __attribute__((__fallthrough__)) | ^~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c:3706:4: note: in expansion of macro 'fallthrough' 3706 | fallthrough; | ^~~~~~~~~~~
Quoted 3 lines
Introduced by commit
e86efa063cd1("AMD POWERPLAY: Use fallthrough;")
This is also one of the #ifdef/#endif pairs
where the fallthrough is outside of the #endif.
https://lore.kernel.org/lkml/[email protected]/
Here is a delta patch for this.
Let me know if another form is needed.
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +1 -1
@@ -3702,8 +3702,8 @@ static int smu7_request_link_speed_change_before_state_change(case PP_PCIEGen2:if (0 ==amdgpu_acpi_pcie_performance_request (hwmgr->adev,PCIE_PERF_REQ_GEN2 , false))break ; -#endif fallthrough; +#endif default : data->force_pcie_gen =smu7_get_current_pcie_speed (hwmgr);break ;
Signature · 1 line
2.24.0
Alex Deucher
AppliedRe: [PATCH] drm/amd/powerplay: Move fallthrough; into containing #ifdef/#endif
Quoted 8 lines · Joe Perches
The automated conversion of /* fallthrough */ comments converted a comment outside of an #ifdef/#endif case block that should be inside the block.
Move the fallthrough inside the block to silence the warning.
Signed-off-by Joe Perches <[email protected]>
Applied. Thanks!
Alex
Quoted 51 lines
---
Quoted 15 lines · Stephen Rothwell
Hi all,
After merging the amdgpu tree, today's linux-next build (powerpc allyesconfig) produced this warning:
In file included from
include/linux/compiler_types.h:59,
from <command-line>:drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c: In function 'smu7_request_link_speed_change_before_state_change':include/linux/compiler_attributes.h:200:41: warning: statement will never be executed [-Wswitch-unreachable]200 | # define fallthrough __attribute__((__fallthrough__)) | ^~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c:3706:4: note: in expansion of macro 'fallthrough' 3706 | fallthrough; | ^~~~~~~~~~~Quoted 3 lines
Introduced by commit
e86efa063cd1("AMD POWERPLAY: Use fallthrough;")This is also one of the #ifdef/#endif pairs
where the fallthrough is outside of the #endif.https://lore.kernel.org/lkml/[email protected]/
Here is a delta patch for this.
Let me know if another form is needed.drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +1
-2@@ -3702,8 +3702,8 @@ static int smu7_request_link_speed_change_before_state_change(case PP_PCIEGen2:if (0 ==amdgpu_acpi_pcie_performance_request (hwmgr->adev,PCIE_PERF_REQ_GEN2 , false))break ; -#endif fallthrough; +#endif default : data->force_pcie_gen =smu7_get_current_pcie_speed (hwmgr);break ; --2.24.0