* [PATCH] powerpc: annotate implicit fall throughs
@ 2018-11-28 22:28 Stephen Rothwell
2018-12-07 13:06 ` Michael Ellerman
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Rothwell @ 2018-11-28 22:28 UTC (permalink / raw)
To: Michael Ellerman
Cc: Gustavo A. R. Silva, Nicholas Piggin, Paul Mackerras, Kees Cook, PowerPC
[-- Attachment #1: Type: text/plain, Size: 2266 bytes --]
There is a plan to build the kernel with -Wimplicit-fallthrough and these
places in the code produced warnings, but because we build arch/powerpc
with -Werror, they became errors. Fix them up.
This patch produces no change in behaviour, but should be reviewed in
case these are actually bugs not intentional fallthoughs.
Cc: Kees Cook <keescook@google.com>
Cc: Gustavo A. R. Silva <gustavo@embeddedor.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Balbir Singh <bsingharora@gmail.com>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/kernel/nvram_64.c | 1 +
arch/powerpc/platforms/powermac/feature.c | 1 +
arch/powerpc/xmon/xmon.c | 1 +
3 files changed, 3 insertions(+)
The patch is relative to v4.20-rc4 and has been in linux-next for a
few days.
diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c
index 22e9d281324d..06e2eda2430e 100644
--- a/arch/powerpc/kernel/nvram_64.c
+++ b/arch/powerpc/kernel/nvram_64.c
@@ -809,6 +809,7 @@ static long dev_nvram_ioctl(struct file *file, unsigned int cmd,
#ifdef CONFIG_PPC_PMAC
case OBSOLETE_PMAC_NVRAM_GET_OFFSET:
printk(KERN_WARNING "nvram: Using obsolete PMAC_NVRAM_GET_OFFSET ioctl\n");
+ /* fall through */
case IOC_NVRAM_GET_OFFSET: {
int part, offset;
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c
index ed2f54b3f173..a7ec06876b53 100644
--- a/arch/powerpc/platforms/powermac/feature.c
+++ b/arch/powerpc/platforms/powermac/feature.c
@@ -1471,6 +1471,7 @@ static long g5_i2s_enable(struct device_node *node, long param, long value)
case 2:
if (macio->type == macio_shasta)
break;
+ /* fall through */
default:
return -ENODEV;
}
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 36b8dc47a3c3..308326f8b7ed 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -4033,6 +4033,7 @@ static int do_spu_cmd(void)
subcmd = inchar();
if (isxdigit(subcmd) || subcmd == '\n')
termch = subcmd;
+ /* fall through */
case 'f':
scanhex(&num);
if (num >= XMON_NUM_SPUS || !spu_info[num].spu) {
--
2.20.0.rc1
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: powerpc: annotate implicit fall throughs
2018-11-28 22:28 [PATCH] powerpc: annotate implicit fall throughs Stephen Rothwell
@ 2018-12-07 13:06 ` Michael Ellerman
0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2018-12-07 13:06 UTC (permalink / raw)
To: Stephen Rothwell
Cc: PowerPC, Kees Cook, Paul Mackerras, Nicholas Piggin, Gustavo A. R. Silva
On Wed, 2018-11-28 at 22:28:30 UTC, Stephen Rothwell wrote:
> There is a plan to build the kernel with -Wimplicit-fallthrough and these
> places in the code produced warnings, but because we build arch/powerpc
> with -Werror, they became errors. Fix them up.
>
> This patch produces no change in behaviour, but should be reviewed in
> case these are actually bugs not intentional fallthoughs.
>
> Cc: Kees Cook <keescook@google.com>
> Cc: Gustavo A. R. Silva <gustavo@embeddedor.com>
> Cc: Nicholas Piggin <npiggin@gmail.com>
> Cc: Balbir Singh <bsingharora@gmail.com>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/8ad940217cce2b6ccc8d8cc7156e9a
cheers
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-12-07 13:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-28 22:28 [PATCH] powerpc: annotate implicit fall throughs Stephen Rothwell
2018-12-07 13:06 ` Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).