Skip to contentSkip to conversation

powerpc: annotate implicit fall throughs

PATCH Applied Stephen Rothwell 2 participants 2 messages Nov 28, 2018 – Dec 7, 2018

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

PATCH 1/1 powerpc: annotate implicit fall throughs

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 <[email protected]>
Cc Gustavo A. R. Silva <[email protected]>
Cc Nicholas Piggin <[email protected]>
Cc Balbir Singh <[email protected]>
---
 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.

arch/powerpc/kernel/nvram_64.c +1 -0
index 22e9d281324d..06e2eda2430e 100644
@@ -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;
 
arch/powerpc/platforms/powermac/feature.c +1 -0
index ed2f54b3f173..a7ec06876b53 100644
@@ -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;
 	}
arch/powerpc/xmon/xmon.c +1 -0
index 36b8dc47a3c3..308326f8b7ed 100644
@@ -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) {
Signature · 5 lines
2.20.0.rc1

-- 
Cheers,
Stephen Rothwell
#1 lore raw
Quoted 4 lines · Stephen Rothwell

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.

Quoted 8 lines

This patch produces no change in behaviour, but should be reviewed in case these are actually bugs not intentional fallthoughs.

Cc Kees Cook <[email protected]>
Cc Gustavo A. R. Silva <[email protected]>
Cc Nicholas Piggin <[email protected]>
Cc Balbir Singh <[email protected]>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/8ad940217cce2b6ccc8d8cc7156e9a

cheers