Skip to contentSkip to conversation

mtd: rawnand: stm32_fmc2: Fix fall-through warnings for Clang

PATCH In review Gustavo A. R. Silva 2 participants 2 messages Mar 5, 2021

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

PATCH v2 1/1 mtd: rawnand: stm32_fmc2: Fix fall-through warnings for Clang

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.

---
Changes in v2:
Make use of a break statement instead of fallthrough for consistency.

 drivers/mtd/nand/raw/stm32_fmc2_nand.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mtd/nand/raw/stm32_fmc2_nand.c +2 -0
index 550bda4d1415..1c277fbb91f2 100644
@@ -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:
Signature · 1 line
2.27.0
Reviewed-by on v2 1/1
#1 lore raw

Hi Gustavo,

Quoted 28 lines · Gustavo A. R. Silva

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.

---
Changes in v2:
Make use of a break statement instead of fallthrough for consistency.

  drivers/mtd/nand/raw/stm32_fmc2_nand.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/mtd/nand/raw/stm32_fmc2_nand.c +1 -0
index 550bda4d1415..1c277fbb91f2 100644
@@ -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:

drivers/mtd/nand/raw/stm32_fmc2_nand.c static int stm32_fmc2_nfc_ham_correct(struct nand_chip *chip, u8 *dat, · line 553

Quoted 7 lines
drivers/mtd/nand/raw/stm32_fmc2_nand.c +1 -0
@@ -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:

Regards,
Christophe Kerello.

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/