* linux-next: build warning after merge of the amdgpu tree
@ 2020-03-13 9:57 Stephen Rothwell
2020-03-13 12:57 ` [PATCH] drm/amd/powerplay: Move fallthrough; into containing #ifdef/#endif Joe Perches
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Rothwell @ 2020-03-13 9:57 UTC (permalink / raw)
To: Alex Deucher
Cc: Linux Next Mailing List, Linux Kernel Mailing List, Joe Perches
[-- Attachment #1: Type: text/plain, Size: 867 bytes --]
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;")
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH] drm/amd/powerplay: Move fallthrough; into containing #ifdef/#endif
2020-03-13 9:57 linux-next: build warning after merge of the amdgpu tree Stephen Rothwell
@ 2020-03-13 12:57 ` Joe Perches
2020-03-13 14:22 ` Alex Deucher
0 siblings, 1 reply; 3+ messages in thread
From: Joe Perches @ 2020-03-13 12:57 UTC (permalink / raw)
To: Stephen Rothwell, Alex Deucher
Cc: Linux Next Mailing List, Linux Kernel Mailing List
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 <joe@perches.com>
---
On Fri, 2020-03-13 at 20:57 +1100, Stephen Rothwell wrote:
> 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;")
This is also one of the #ifdef/#endif pairs
where the fallthrough is outside of the #endif.
https://lore.kernel.org/lkml/cover.1584040050.git.joe@perches.com/
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(-)
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
index fc5236c..774048 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
@@ -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
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] drm/amd/powerplay: Move fallthrough; into containing #ifdef/#endif
2020-03-13 12:57 ` [PATCH] drm/amd/powerplay: Move fallthrough; into containing #ifdef/#endif Joe Perches
@ 2020-03-13 14:22 ` Alex Deucher
0 siblings, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2020-03-13 14:22 UTC (permalink / raw)
To: Joe Perches
Cc: Stephen Rothwell, Linux Next Mailing List, Linux Kernel Mailing List
On Fri, Mar 13, 2020 at 8:59 AM Joe Perches <joe@perches.com> wrote:
>
> 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 <joe@perches.com>
Applied. Thanks!
Alex
> ---
>
> On Fri, 2020-03-13 at 20:57 +1100, Stephen Rothwell wrote:
> > 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;")
>
> This is also one of the #ifdef/#endif pairs
> where the fallthrough is outside of the #endif.
>
> https://lore.kernel.org/lkml/cover.1584040050.git.joe@perches.com/
>
> 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(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
> index fc5236c..774048 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
> @@ -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
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-03-13 14:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-13 9:57 linux-next: build warning after merge of the amdgpu tree Stephen Rothwell
2020-03-13 12:57 ` [PATCH] drm/amd/powerplay: Move fallthrough; into containing #ifdef/#endif Joe Perches
2020-03-13 14:22 ` Alex Deucher
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®