* [PATCH v2][next] mtd: rawnand: stm32_fmc2: Fix fall-through warnings for Clang
@ 2021-03-05 8:09 Gustavo A. R. Silva
2021-03-05 8:33 ` [Linux-stm32] " Christophe Kerello
0 siblings, 1 reply; 2+ messages in thread
From: Gustavo A. R. Silva @ 2021-03-05 8:09 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Maxime Coquelin, Alexandre Torgue
Cc: linux-mtd, linux-stm32, linux-arm-kernel, linux-kernel,
Gustavo A. R. Silva, linux-hardening
In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple
of warnings by explicitly adding a couple of fallthrough pseudo-keywords
instead of letting the code fall through to the next case.
Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
Changes in v2:
Make use of a break statement instead of fallthrough for consistency.
Link: https://lore.kernel.org/lkml/20201123093347.719a77cf@xps13/
drivers/mtd/nand/raw/stm32_fmc2_nand.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/mtd/nand/raw/stm32_fmc2_nand.c b/drivers/mtd/nand/raw/stm32_fmc2_nand.c
index 550bda4d1415..1c277fbb91f2 100644
--- a/drivers/mtd/nand/raw/stm32_fmc2_nand.c
+++ b/drivers/mtd/nand/raw/stm32_fmc2_nand.c
@@ -531,6 +531,7 @@ static int stm32_fmc2_nfc_ham_correct(struct nand_chip *chip, u8 *dat,
switch (b % 4) {
case 2:
bit_position += shifting;
+ break;
case 1:
break;
default:
@@ -546,6 +547,7 @@ static int stm32_fmc2_nfc_ham_correct(struct nand_chip *chip, u8 *dat,
switch (b % 4) {
case 2:
byte_addr += shifting;
+ break;
case 1:
break;
default:
--
2.27.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Linux-stm32] [PATCH v2][next] mtd: rawnand: stm32_fmc2: Fix fall-through warnings for Clang
2021-03-05 8:09 [PATCH v2][next] mtd: rawnand: stm32_fmc2: Fix fall-through warnings for Clang Gustavo A. R. Silva
@ 2021-03-05 8:33 ` Christophe Kerello
0 siblings, 0 replies; 2+ messages in thread
From: Christophe Kerello @ 2021-03-05 8:33 UTC (permalink / raw)
To: Gustavo A. R. Silva, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, Maxime Coquelin, Alexandre Torgue
Cc: linux-kernel, linux-mtd, linux-hardening, linux-stm32, linux-arm-kernel
Hi Gustavo,
On 3/5/21 9:09 AM, Gustavo A. R. Silva wrote:
> In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple
> of warnings by explicitly adding a couple of fallthrough pseudo-keywords
> instead of letting the code fall through to the next case.
>
> Link: https://github.com/KSPP/linux/issues/115
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> ---
> Changes in v2:
> Make use of a break statement instead of fallthrough for consistency.
> Link: https://lore.kernel.org/lkml/20201123093347.719a77cf@xps13/
>
> drivers/mtd/nand/raw/stm32_fmc2_nand.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/mtd/nand/raw/stm32_fmc2_nand.c b/drivers/mtd/nand/raw/stm32_fmc2_nand.c
> index 550bda4d1415..1c277fbb91f2 100644
> --- a/drivers/mtd/nand/raw/stm32_fmc2_nand.c
> +++ b/drivers/mtd/nand/raw/stm32_fmc2_nand.c
> @@ -531,6 +531,7 @@ static int stm32_fmc2_nfc_ham_correct(struct nand_chip *chip, u8 *dat,
> switch (b % 4) {
> case 2:
> bit_position += shifting;
> + break;
> case 1:
> break;
> default:
> @@ -546,6 +547,7 @@ static int stm32_fmc2_nfc_ham_correct(struct nand_chip *chip, u8 *dat,
> switch (b % 4) {
> case 2:
> byte_addr += shifting;
> + break;
> case 1:
> break;
> default:
>
Reviewed-by: Christophe Kerello <christophe.kerello@foss.st.com>
Regards,
Christophe Kerello.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-05 8:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-05 8:09 [PATCH v2][next] mtd: rawnand: stm32_fmc2: Fix fall-through warnings for Clang Gustavo A. R. Silva
2021-03-05 8:33 ` [Linux-stm32] " Christophe Kerello
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).