* [PATCH] mips: annotate implicit fall throughs
@ 2018-12-03 21:22 Mathieu Malaterre
2018-12-03 21:27 ` Boris Brezillon
2018-12-04 20:10 ` [PATCH v2] mtd: rawnand: jz4780: " Mathieu Malaterre
0 siblings, 2 replies; 6+ messages in thread
From: Mathieu Malaterre @ 2018-12-03 21:22 UTC (permalink / raw)
To: Paul Burton
Cc: trivial, kernel-janitors, Mathieu Malaterre, Harvey Hunt,
Boris Brezillon, Miquel Raynal, Richard Weinberger,
David Woodhouse, Brian Norris, Marek Vasut, linux-mtd,
linux-kernel
There is a plan to build the kernel with -Wimplicit-fallthrough and
these places in the code produced warnings. Fix them up.
Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
drivers/mtd/nand/raw/jz4780_bch.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/mtd/nand/raw/jz4780_bch.c b/drivers/mtd/nand/raw/jz4780_bch.c
index 731c6051d91e..7201827809e9 100644
--- a/drivers/mtd/nand/raw/jz4780_bch.c
+++ b/drivers/mtd/nand/raw/jz4780_bch.c
@@ -136,8 +136,10 @@ static void jz4780_bch_read_parity(struct jz4780_bch *bch, void *buf,
switch (size8) {
case 3:
dest8[2] = (val >> 16) & 0xff;
+ /* fall through */
case 2:
dest8[1] = (val >> 8) & 0xff;
+ /* fall through */
case 1:
dest8[0] = val & 0xff;
break;
--
2.19.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] mips: annotate implicit fall throughs
@ 2018-12-03 21:23 Mathieu Malaterre
2018-12-03 21:46 ` Paul Burton
0 siblings, 1 reply; 6+ messages in thread
From: Mathieu Malaterre @ 2018-12-03 21:23 UTC (permalink / raw)
To: Paul Burton
Cc: Mathieu Malaterre, Kees Cook, Ralf Baechle, James Hogan,
linux-mips, linux-kernel
There is a plan to build the kernel with -Wimplicit-fallthrough and
these places in the code produced warnings. 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>
Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
arch/mips/kernel/branch.c | 7 +++++++
arch/mips/kernel/cpu-probe.c | 7 +++++++
arch/mips/kernel/watch.c | 13 +++++++++++++
arch/mips/mm/c-r4k.c | 2 ++
arch/mips/mm/tlbex.c | 1 +
5 files changed, 30 insertions(+)
diff --git a/arch/mips/kernel/branch.c b/arch/mips/kernel/branch.c
index e48f6c0a9e4a..a81862493c3d 100644
--- a/arch/mips/kernel/branch.c
+++ b/arch/mips/kernel/branch.c
@@ -447,6 +447,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
case bltzl_op:
if (NO_R6EMU)
goto sigill_r2r6;
+ /* fall through */
case bltz_op:
if ((long)regs->regs[insn.i_format.rs] < 0) {
epc = epc + 4 + (insn.i_format.simmediate << 2);
@@ -460,6 +461,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
case bgezl_op:
if (NO_R6EMU)
goto sigill_r2r6;
+ /* fall through */
case bgez_op:
if ((long)regs->regs[insn.i_format.rs] >= 0) {
epc = epc + 4 + (insn.i_format.simmediate << 2);
@@ -555,6 +557,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
case jalx_op:
case jal_op:
regs->regs[31] = regs->cp0_epc + 8;
+ /* fall through */
case j_op:
epc += 4;
epc >>= 28;
@@ -571,6 +574,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
case beql_op:
if (NO_R6EMU)
goto sigill_r2r6;
+ /* fall through */
case beq_op:
if (regs->regs[insn.i_format.rs] ==
regs->regs[insn.i_format.rt]) {
@@ -585,6 +589,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
case bnel_op:
if (NO_R6EMU)
goto sigill_r2r6;
+ /* fall through */
case bne_op:
if (regs->regs[insn.i_format.rs] !=
regs->regs[insn.i_format.rt]) {
@@ -599,6 +604,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
case blezl_op: /* not really i_format */
if (!insn.i_format.rt && NO_R6EMU)
goto sigill_r2r6;
+ /* fall through */
case blez_op:
/*
* Compact branches for R6 for the
@@ -634,6 +640,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
case bgtzl_op:
if (!insn.i_format.rt && NO_R6EMU)
goto sigill_r2r6;
+ /* fall through */
case bgtz_op:
/*
* Compact branches for R6 for the
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index d535fc706a8b..7f4df795d1d2 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -489,12 +489,16 @@ static void set_isa(struct cpuinfo_mips *c, unsigned int isa)
switch (isa) {
case MIPS_CPU_ISA_M64R2:
c->isa_level |= MIPS_CPU_ISA_M32R2 | MIPS_CPU_ISA_M64R2;
+ /* fall through */
case MIPS_CPU_ISA_M64R1:
c->isa_level |= MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M64R1;
+ /* fall through */
case MIPS_CPU_ISA_V:
c->isa_level |= MIPS_CPU_ISA_V;
+ /* fall through */
case MIPS_CPU_ISA_IV:
c->isa_level |= MIPS_CPU_ISA_IV;
+ /* fall through */
case MIPS_CPU_ISA_III:
c->isa_level |= MIPS_CPU_ISA_II | MIPS_CPU_ISA_III;
break;
@@ -502,14 +506,17 @@ static void set_isa(struct cpuinfo_mips *c, unsigned int isa)
/* R6 incompatible with everything else */
case MIPS_CPU_ISA_M64R6:
c->isa_level |= MIPS_CPU_ISA_M32R6 | MIPS_CPU_ISA_M64R6;
+ /* fall through */
case MIPS_CPU_ISA_M32R6:
c->isa_level |= MIPS_CPU_ISA_M32R6;
/* Break here so we don't add incompatible ISAs */
break;
case MIPS_CPU_ISA_M32R2:
c->isa_level |= MIPS_CPU_ISA_M32R2;
+ /* fall through */
case MIPS_CPU_ISA_M32R1:
c->isa_level |= MIPS_CPU_ISA_M32R1;
+ /* fall through */
case MIPS_CPU_ISA_II:
c->isa_level |= MIPS_CPU_ISA_II;
break;
diff --git a/arch/mips/kernel/watch.c b/arch/mips/kernel/watch.c
index 0e61a5b7647f..ba73b4077668 100644
--- a/arch/mips/kernel/watch.c
+++ b/arch/mips/kernel/watch.c
@@ -27,12 +27,15 @@ void mips_install_watch_registers(struct task_struct *t)
case 4:
write_c0_watchlo3(watches->watchlo[3]);
write_c0_watchhi3(watchhi | watches->watchhi[3]);
+ /* fall through */
case 3:
write_c0_watchlo2(watches->watchlo[2]);
write_c0_watchhi2(watchhi | watches->watchhi[2]);
+ /* fall through */
case 2:
write_c0_watchlo1(watches->watchlo[1]);
write_c0_watchhi1(watchhi | watches->watchhi[1]);
+ /* fall through */
case 1:
write_c0_watchlo0(watches->watchlo[0]);
write_c0_watchhi0(watchhi | watches->watchhi[0]);
@@ -55,10 +58,13 @@ void mips_read_watch_registers(void)
BUG();
case 4:
watches->watchhi[3] = (read_c0_watchhi3() & watchhi_mask);
+ /* fall through */
case 3:
watches->watchhi[2] = (read_c0_watchhi2() & watchhi_mask);
+ /* fall through */
case 2:
watches->watchhi[1] = (read_c0_watchhi1() & watchhi_mask);
+ /* fall through */
case 1:
watches->watchhi[0] = (read_c0_watchhi0() & watchhi_mask);
}
@@ -85,18 +91,25 @@ void mips_clear_watch_registers(void)
BUG();
case 8:
write_c0_watchlo7(0);
+ /* fall through */
case 7:
write_c0_watchlo6(0);
+ /* fall through */
case 6:
write_c0_watchlo5(0);
+ /* fall through */
case 5:
write_c0_watchlo4(0);
+ /* fall through */
case 4:
write_c0_watchlo3(0);
+ /* fall through */
case 3:
write_c0_watchlo2(0);
+ /* fall through */
case 2:
write_c0_watchlo1(0);
+ /* fall through */
case 1:
write_c0_watchlo0(0);
}
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index 05bd77727fb9..4f0e1fc9f887 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -1251,6 +1251,7 @@ static void probe_pcache(void)
case CPU_VR4133:
write_c0_config(config & ~VR41_CONF_P4K);
+ /* fall through */
case CPU_VR4131:
/* Workaround for cache instruction bug of VR4131 */
if (c->processor_id == 0x0c80U || c->processor_id == 0x0c81U ||
@@ -1498,6 +1499,7 @@ static void probe_pcache(void)
c->dcache.flags |= MIPS_CACHE_PINDEX;
break;
}
+ /* fall through */
default:
if (has_74k_erratum || c->dcache.waysize > PAGE_SIZE)
c->dcache.flags |= MIPS_CACHE_ALIASES;
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index 067714291643..37b1cb246332 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -576,6 +576,7 @@ void build_tlb_write_entry(u32 **p, struct uasm_label **l,
case CPU_R5500:
if (m4kc_tlbp_war())
uasm_i_nop(p);
+ /* fall through */
case CPU_ALCHEMY:
tlbw(p);
break;
--
2.19.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] mips: annotate implicit fall throughs
2018-12-03 21:22 [PATCH] mips: annotate implicit fall throughs Mathieu Malaterre
@ 2018-12-03 21:27 ` Boris Brezillon
2018-12-04 20:10 ` [PATCH v2] mtd: rawnand: jz4780: " Mathieu Malaterre
1 sibling, 0 replies; 6+ messages in thread
From: Boris Brezillon @ 2018-12-03 21:27 UTC (permalink / raw)
To: Mathieu Malaterre
Cc: Paul Burton, trivial, kernel-janitors, Harvey Hunt, Miquel Raynal,
Richard Weinberger, David Woodhouse, Brian Norris, Marek Vasut,
linux-mtd, linux-kernel
Hi Mathieu,
The subject prefix should be "mtd: rawnand: jz4780:" not "mips:"
Regards,
Boris
On Mon, 3 Dec 2018 22:22:13 +0100
Mathieu Malaterre <malat@debian.org> wrote:
> There is a plan to build the kernel with -Wimplicit-fallthrough and
> these places in the code produced warnings. Fix them up.
>
> Signed-off-by: Mathieu Malaterre <malat@debian.org>
> ---
> drivers/mtd/nand/raw/jz4780_bch.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/mtd/nand/raw/jz4780_bch.c b/drivers/mtd/nand/raw/jz4780_bch.c
> index 731c6051d91e..7201827809e9 100644
> --- a/drivers/mtd/nand/raw/jz4780_bch.c
> +++ b/drivers/mtd/nand/raw/jz4780_bch.c
> @@ -136,8 +136,10 @@ static void jz4780_bch_read_parity(struct jz4780_bch *bch, void *buf,
> switch (size8) {
> case 3:
> dest8[2] = (val >> 16) & 0xff;
> + /* fall through */
> case 2:
> dest8[1] = (val >> 8) & 0xff;
> + /* fall through */
> case 1:
> dest8[0] = val & 0xff;
> break;
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mips: annotate implicit fall throughs
2018-12-03 21:23 [PATCH] mips: " Mathieu Malaterre
@ 2018-12-03 21:46 ` Paul Burton
0 siblings, 0 replies; 6+ messages in thread
From: Paul Burton @ 2018-12-03 21:46 UTC (permalink / raw)
To: Mathieu Malaterre
Cc: Paul Burton, Mathieu Malaterre, Kees Cook, Ralf Baechle,
James Hogan, linux-mips@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org
Hello,
Mathieu Malaterre wrote:
> There is a plan to build the kernel with -Wimplicit-fallthrough and
> these places in the code produced warnings. 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>
> Signed-off-by: Mathieu Malaterre <malat@debian.org>
Applied to mips-next.
Thanks,
Paul
[ This message was auto-generated; if you believe anything is incorrect
then please email paul.burton@mips.com to report it. ]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2] mtd: rawnand: jz4780: annotate implicit fall throughs
2018-12-03 21:22 [PATCH] mips: annotate implicit fall throughs Mathieu Malaterre
2018-12-03 21:27 ` Boris Brezillon
@ 2018-12-04 20:10 ` Mathieu Malaterre
2018-12-07 18:51 ` Miquel Raynal
1 sibling, 1 reply; 6+ messages in thread
From: Mathieu Malaterre @ 2018-12-04 20:10 UTC (permalink / raw)
To: Paul Burton
Cc: trivial, kernel-janitors, Mathieu Malaterre, Harvey Hunt,
Boris Brezillon, Miquel Raynal, Richard Weinberger,
David Woodhouse, Brian Norris, Marek Vasut, linux-mtd,
linux-kernel
There is a plan to build the kernel with -Wimplicit-fallthrough and
these places in the code produced warnings. Fix them up.
Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
v2: fix subject prefix non sense
drivers/mtd/nand/raw/jz4780_bch.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/mtd/nand/raw/jz4780_bch.c b/drivers/mtd/nand/raw/jz4780_bch.c
index 731c6051d91e..7201827809e9 100644
--- a/drivers/mtd/nand/raw/jz4780_bch.c
+++ b/drivers/mtd/nand/raw/jz4780_bch.c
@@ -136,8 +136,10 @@ static void jz4780_bch_read_parity(struct jz4780_bch *bch, void *buf,
switch (size8) {
case 3:
dest8[2] = (val >> 16) & 0xff;
+ /* fall through */
case 2:
dest8[1] = (val >> 8) & 0xff;
+ /* fall through */
case 1:
dest8[0] = val & 0xff;
break;
--
2.19.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2] mtd: rawnand: jz4780: annotate implicit fall throughs
2018-12-04 20:10 ` [PATCH v2] mtd: rawnand: jz4780: " Mathieu Malaterre
@ 2018-12-07 18:51 ` Miquel Raynal
0 siblings, 0 replies; 6+ messages in thread
From: Miquel Raynal @ 2018-12-07 18:51 UTC (permalink / raw)
To: Mathieu Malaterre
Cc: Paul Burton, trivial, kernel-janitors, Harvey Hunt,
Boris Brezillon, Richard Weinberger, David Woodhouse,
Brian Norris, Marek Vasut, linux-mtd, linux-kernel
Hi Mathieu,
Mathieu Malaterre <malat@debian.org> wrote on Tue, 4 Dec 2018 21:10:57
+0100:
> There is a plan to build the kernel with -Wimplicit-fallthrough and
> these places in the code produced warnings. Fix them up.
>
> Signed-off-by: Mathieu Malaterre <malat@debian.org>
> ---
> v2: fix subject prefix non sense
>
> drivers/mtd/nand/raw/jz4780_bch.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/mtd/nand/raw/jz4780_bch.c b/drivers/mtd/nand/raw/jz4780_bch.c
> index 731c6051d91e..7201827809e9 100644
> --- a/drivers/mtd/nand/raw/jz4780_bch.c
> +++ b/drivers/mtd/nand/raw/jz4780_bch.c
> @@ -136,8 +136,10 @@ static void jz4780_bch_read_parity(struct jz4780_bch *bch, void *buf,
> switch (size8) {
> case 3:
> dest8[2] = (val >> 16) & 0xff;
> + /* fall through */
> case 2:
> dest8[1] = (val >> 8) & 0xff;
> + /* fall through */
> case 1:
> dest8[0] = val & 0xff;
> break;
Applied to nand/next.
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-12-07 18:51 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-03 21:22 [PATCH] mips: annotate implicit fall throughs Mathieu Malaterre
2018-12-03 21:27 ` Boris Brezillon
2018-12-04 20:10 ` [PATCH v2] mtd: rawnand: jz4780: " Mathieu Malaterre
2018-12-07 18:51 ` Miquel Raynal
-- strict thread matches above, loose matches on Subject: below --
2018-12-03 21:23 [PATCH] mips: " Mathieu Malaterre
2018-12-03 21:46 ` Paul Burton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox