[PATCH v2][next] mtd: rawnand: stm32_fmc2: Fix fall-through warnings for Clang

Subsystems: memory technology devices (mtd), nand flash subsystem, the rest

STALE1975d

2 messages, 2 authors, 2021-03-05 · open the first message on its own page

[PATCH v2][next] mtd: rawnand: stm32_fmc2: Fix fall-through warnings for Clang

From: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Date: 2021-03-05 08:09:18

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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Re: [Linux-stm32] [PATCH v2][next] mtd: rawnand: stm32_fmc2: Fix fall-through warnings for Clang

From: Christophe Kerello <hidden>
Date: 2021-03-05 08:34:54

Hi Gustavo,

On 3/5/21 9:09 AM, Gustavo A. R. Silva wrote:
quoted hunk
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 <redacted>

Regards,
Christophe Kerello.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help