All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: rawnand: mark expected switch fall-throughs
@ 2019-01-25 21:09 ` Gustavo A. R. Silva
  0 siblings, 0 replies; 18+ messages in thread
From: Gustavo A. R. Silva @ 2019-01-25 21:09 UTC (permalink / raw)
  To: Kyungmin Park, Boris Brezillon, Miquel Raynal,
	Richard Weinberger, David Woodhouse, Brian Norris, Marek Vasut,
	Wan ZongShun
  Cc: linux-mtd, linux-kernel, linux-arm-kernel, Gustavo A. R. Silva,
	Kees Cook

In preparation to enabling -Wimplicit-fallthrough, mark switch
cases where we are expecting to fall through.

This patch fixes the following warning:

drivers/mtd/nand/onenand/onenand_base.c:3264:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/onenand/onenand_base.c:3288:17: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/nand_base.c:5538:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/nand_base.c:5557:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/nand_base.c:5595:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/nand_legacy.c:332:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/nand_legacy.c:483:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/nandsim.c:2254:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/omap_elm.c:512:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/omap_elm.c:517:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/omap_elm.c:466:37: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/omap_elm.c:471:37: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/nuc900_nand.c: In function ‘nuc900_nand_command_lp’:
./arch/x86/include/asm/io.h:91:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
 #define __raw_writel __writel
drivers/mtd/nand/raw/nuc900_nand.c:52:2: note: in expansion of macro ‘__raw_writel’
  __raw_writel((val), (dev)->reg + REG_SMCMD)
  ^~~~~~~~~~~~
drivers/mtd/nand/raw/nuc900_nand.c:196:3: note: in expansion of macro ‘write_cmd_reg’
   write_cmd_reg(nand, NAND_CMD_READSTART);
   ^~~~~~~~~~~~~
drivers/mtd/nand/raw/nuc900_nand.c:197:2: note: here
  default:
  ^~~~~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

This patch is part of the ongoing efforts to enabling
-Wimplicit-fallthrough.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/mtd/nand/onenand/onenand_base.c | 2 ++
 drivers/mtd/nand/raw/diskonchip.c       | 1 +
 drivers/mtd/nand/raw/nand_base.c        | 3 +++
 drivers/mtd/nand/raw/nand_legacy.c      | 3 ++-
 drivers/mtd/nand/raw/nandsim.c          | 5 +++--
 drivers/mtd/nand/raw/nuc900_nand.c      | 3 ++-
 drivers/mtd/nand/raw/omap_elm.c         | 4 ++++
 7 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/onenand/onenand_base.c b/drivers/mtd/nand/onenand/onenand_base.c
index 4ca4b194e7d7..e9b71ad24f50 100644
--- a/drivers/mtd/nand/onenand/onenand_base.c
+++ b/drivers/mtd/nand/onenand/onenand_base.c
@@ -3280,12 +3280,14 @@ static void onenand_check_features(struct mtd_info *mtd)
 			if ((this->version_id & 0xf) == 0xe)
 				this->options |= ONENAND_HAS_NOP_1;
 		}
+		/* fall through */
 
 	case ONENAND_DEVICE_DENSITY_2Gb:
 		/* 2Gb DDP does not have 2 plane */
 		if (!ONENAND_IS_DDP(this))
 			this->options |= ONENAND_HAS_2PLANE;
 		this->options |= ONENAND_HAS_UNLOCK_ALL;
+		/* fall through */
 
 	case ONENAND_DEVICE_DENSITY_1Gb:
 		/* A-Die has all block unlock */
diff --git a/drivers/mtd/nand/raw/diskonchip.c b/drivers/mtd/nand/raw/diskonchip.c
index 53f57e0f007e..ead54c90f2d1 100644
--- a/drivers/mtd/nand/raw/diskonchip.c
+++ b/drivers/mtd/nand/raw/diskonchip.c
@@ -1477,6 +1477,7 @@ static int __init doc_probe(unsigned long physadr)
 			break;
 		case DOC_ChipID_DocMilPlus32:
 			pr_err("DiskOnChip Millennium Plus 32MB is not supported, ignoring.\n");
+			/* fall through */
 		default:
 			ret = -ENODEV;
 			goto notfound;
diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
index 96cadead262e..e05ecf2e4269 100644
--- a/drivers/mtd/nand/raw/nand_base.c
+++ b/drivers/mtd/nand/raw/nand_base.c
@@ -5537,6 +5537,7 @@ static int nand_scan_tail(struct nand_chip *chip)
 		}
 		if (!ecc->read_page)
 			ecc->read_page = nand_read_page_hwecc_oob_first;
+		/* fall through */
 
 	case NAND_ECC_HW:
 		/* Use standard hwecc read page function? */
@@ -5556,6 +5557,7 @@ static int nand_scan_tail(struct nand_chip *chip)
 			ecc->read_subpage = nand_read_subpage;
 		if (!ecc->write_subpage && ecc->hwctl && ecc->calculate)
 			ecc->write_subpage = nand_write_subpage_hwecc;
+		/* fall through */
 
 	case NAND_ECC_HW_SYNDROME:
 		if ((!ecc->calculate || !ecc->correct || !ecc->hwctl) &&
@@ -5593,6 +5595,7 @@ static int nand_scan_tail(struct nand_chip *chip)
 			ecc->size, mtd->writesize);
 		ecc->mode = NAND_ECC_SOFT;
 		ecc->algo = NAND_ECC_HAMMING;
+		/* fall through */
 
 	case NAND_ECC_SOFT:
 		ret = nand_set_ecc_soft_ops(chip);
diff --git a/drivers/mtd/nand/raw/nand_legacy.c b/drivers/mtd/nand/raw/nand_legacy.c
index 43575943f13b..f2526ec616a6 100644
--- a/drivers/mtd/nand/raw/nand_legacy.c
+++ b/drivers/mtd/nand/raw/nand_legacy.c
@@ -331,6 +331,7 @@ static void nand_command(struct nand_chip *chip, unsigned int command,
 		 */
 		if (column == -1 && page_addr == -1)
 			return;
+		/* fall through */
 
 	default:
 		/*
@@ -483,7 +484,7 @@ static void nand_command_lp(struct nand_chip *chip, unsigned int command,
 		chip->legacy.cmd_ctrl(chip, NAND_CMD_NONE,
 				      NAND_NCE | NAND_CTRL_CHANGE);
 
-		/* This applies to read commands */
+		/* fall through - This applies to read commands */
 	default:
 		/*
 		 * If we don't have access to the busy pin, we apply the given
diff --git a/drivers/mtd/nand/raw/nandsim.c b/drivers/mtd/nand/raw/nandsim.c
index 933d1a629c51..d33e15dc4cdc 100644
--- a/drivers/mtd/nand/raw/nandsim.c
+++ b/drivers/mtd/nand/raw/nandsim.c
@@ -2251,9 +2251,10 @@ static int __init ns_init_module(void)
 
 	switch (bbt) {
 	case 2:
-		 chip->bbt_options |= NAND_BBT_NO_OOB;
+		chip->bbt_options |= NAND_BBT_NO_OOB;
+		/* fall through */
 	case 1:
-		 chip->bbt_options |= NAND_BBT_USE_FLASH;
+		chip->bbt_options |= NAND_BBT_USE_FLASH;
 	case 0:
 		break;
 	default:
diff --git a/drivers/mtd/nand/raw/nuc900_nand.c b/drivers/mtd/nand/raw/nuc900_nand.c
index 38b1994e7ed3..56fa84029482 100644
--- a/drivers/mtd/nand/raw/nuc900_nand.c
+++ b/drivers/mtd/nand/raw/nuc900_nand.c
@@ -192,8 +192,9 @@ static void nuc900_nand_command_lp(struct nand_chip *chip,
 		return;
 
 	case NAND_CMD_READ0:
-
 		write_cmd_reg(nand, NAND_CMD_READSTART);
+		/* fall through */
+
 	default:
 
 		if (!chip->legacy.dev_ready) {
diff --git a/drivers/mtd/nand/raw/omap_elm.c b/drivers/mtd/nand/raw/omap_elm.c
index a3f32f939cc1..94c6401ef32f 100644
--- a/drivers/mtd/nand/raw/omap_elm.c
+++ b/drivers/mtd/nand/raw/omap_elm.c
@@ -465,11 +465,13 @@ static int elm_context_save(struct elm_info *info)
 					ELM_SYNDROME_FRAGMENT_5 + offset);
 			regs->elm_syndrome_fragment_4[i] = elm_read_reg(info,
 					ELM_SYNDROME_FRAGMENT_4 + offset);
+			/* fall through */
 		case BCH8_ECC:
 			regs->elm_syndrome_fragment_3[i] = elm_read_reg(info,
 					ELM_SYNDROME_FRAGMENT_3 + offset);
 			regs->elm_syndrome_fragment_2[i] = elm_read_reg(info,
 					ELM_SYNDROME_FRAGMENT_2 + offset);
+			/* fall through */
 		case BCH4_ECC:
 			regs->elm_syndrome_fragment_1[i] = elm_read_reg(info,
 					ELM_SYNDROME_FRAGMENT_1 + offset);
@@ -511,11 +513,13 @@ static int elm_context_restore(struct elm_info *info)
 					regs->elm_syndrome_fragment_5[i]);
 			elm_write_reg(info, ELM_SYNDROME_FRAGMENT_4 + offset,
 					regs->elm_syndrome_fragment_4[i]);
+			/* fall through */
 		case BCH8_ECC:
 			elm_write_reg(info, ELM_SYNDROME_FRAGMENT_3 + offset,
 					regs->elm_syndrome_fragment_3[i]);
 			elm_write_reg(info, ELM_SYNDROME_FRAGMENT_2 + offset,
 					regs->elm_syndrome_fragment_2[i]);
+			/* fall through */
 		case BCH4_ECC:
 			elm_write_reg(info, ELM_SYNDROME_FRAGMENT_1 + offset,
 					regs->elm_syndrome_fragment_1[i]);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH] mtd: rawnand: mark expected switch fall-throughs
@ 2019-01-25 21:09 ` Gustavo A. R. Silva
  0 siblings, 0 replies; 18+ messages in thread
From: Gustavo A. R. Silva @ 2019-01-25 21:09 UTC (permalink / raw)
  To: Kyungmin Park, Boris Brezillon, Miquel Raynal,
	Richard Weinberger, David Woodhouse, Brian Norris, Marek Vasut,
	Wan ZongShun
  Cc: Kees Cook, linux-mtd, linux-kernel, linux-arm-kernel,
	Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch
cases where we are expecting to fall through.

This patch fixes the following warning:

drivers/mtd/nand/onenand/onenand_base.c:3264:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/onenand/onenand_base.c:3288:17: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/nand_base.c:5538:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/nand_base.c:5557:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/nand_base.c:5595:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/nand_legacy.c:332:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/nand_legacy.c:483:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/nandsim.c:2254:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/omap_elm.c:512:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/omap_elm.c:517:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/omap_elm.c:466:37: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/omap_elm.c:471:37: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/nuc900_nand.c: In function ‘nuc900_nand_command_lp’:
./arch/x86/include/asm/io.h:91:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
 #define __raw_writel __writel
drivers/mtd/nand/raw/nuc900_nand.c:52:2: note: in expansion of macro ‘__raw_writel’
  __raw_writel((val), (dev)->reg + REG_SMCMD)
  ^~~~~~~~~~~~
drivers/mtd/nand/raw/nuc900_nand.c:196:3: note: in expansion of macro ‘write_cmd_reg’
   write_cmd_reg(nand, NAND_CMD_READSTART);
   ^~~~~~~~~~~~~
drivers/mtd/nand/raw/nuc900_nand.c:197:2: note: here
  default:
  ^~~~~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

This patch is part of the ongoing efforts to enabling
-Wimplicit-fallthrough.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/mtd/nand/onenand/onenand_base.c | 2 ++
 drivers/mtd/nand/raw/diskonchip.c       | 1 +
 drivers/mtd/nand/raw/nand_base.c        | 3 +++
 drivers/mtd/nand/raw/nand_legacy.c      | 3 ++-
 drivers/mtd/nand/raw/nandsim.c          | 5 +++--
 drivers/mtd/nand/raw/nuc900_nand.c      | 3 ++-
 drivers/mtd/nand/raw/omap_elm.c         | 4 ++++
 7 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/onenand/onenand_base.c b/drivers/mtd/nand/onenand/onenand_base.c
index 4ca4b194e7d7..e9b71ad24f50 100644
--- a/drivers/mtd/nand/onenand/onenand_base.c
+++ b/drivers/mtd/nand/onenand/onenand_base.c
@@ -3280,12 +3280,14 @@ static void onenand_check_features(struct mtd_info *mtd)
 			if ((this->version_id & 0xf) == 0xe)
 				this->options |= ONENAND_HAS_NOP_1;
 		}
+		/* fall through */
 
 	case ONENAND_DEVICE_DENSITY_2Gb:
 		/* 2Gb DDP does not have 2 plane */
 		if (!ONENAND_IS_DDP(this))
 			this->options |= ONENAND_HAS_2PLANE;
 		this->options |= ONENAND_HAS_UNLOCK_ALL;
+		/* fall through */
 
 	case ONENAND_DEVICE_DENSITY_1Gb:
 		/* A-Die has all block unlock */
diff --git a/drivers/mtd/nand/raw/diskonchip.c b/drivers/mtd/nand/raw/diskonchip.c
index 53f57e0f007e..ead54c90f2d1 100644
--- a/drivers/mtd/nand/raw/diskonchip.c
+++ b/drivers/mtd/nand/raw/diskonchip.c
@@ -1477,6 +1477,7 @@ static int __init doc_probe(unsigned long physadr)
 			break;
 		case DOC_ChipID_DocMilPlus32:
 			pr_err("DiskOnChip Millennium Plus 32MB is not supported, ignoring.\n");
+			/* fall through */
 		default:
 			ret = -ENODEV;
 			goto notfound;
diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
index 96cadead262e..e05ecf2e4269 100644
--- a/drivers/mtd/nand/raw/nand_base.c
+++ b/drivers/mtd/nand/raw/nand_base.c
@@ -5537,6 +5537,7 @@ static int nand_scan_tail(struct nand_chip *chip)
 		}
 		if (!ecc->read_page)
 			ecc->read_page = nand_read_page_hwecc_oob_first;
+		/* fall through */
 
 	case NAND_ECC_HW:
 		/* Use standard hwecc read page function? */
@@ -5556,6 +5557,7 @@ static int nand_scan_tail(struct nand_chip *chip)
 			ecc->read_subpage = nand_read_subpage;
 		if (!ecc->write_subpage && ecc->hwctl && ecc->calculate)
 			ecc->write_subpage = nand_write_subpage_hwecc;
+		/* fall through */
 
 	case NAND_ECC_HW_SYNDROME:
 		if ((!ecc->calculate || !ecc->correct || !ecc->hwctl) &&
@@ -5593,6 +5595,7 @@ static int nand_scan_tail(struct nand_chip *chip)
 			ecc->size, mtd->writesize);
 		ecc->mode = NAND_ECC_SOFT;
 		ecc->algo = NAND_ECC_HAMMING;
+		/* fall through */
 
 	case NAND_ECC_SOFT:
 		ret = nand_set_ecc_soft_ops(chip);
diff --git a/drivers/mtd/nand/raw/nand_legacy.c b/drivers/mtd/nand/raw/nand_legacy.c
index 43575943f13b..f2526ec616a6 100644
--- a/drivers/mtd/nand/raw/nand_legacy.c
+++ b/drivers/mtd/nand/raw/nand_legacy.c
@@ -331,6 +331,7 @@ static void nand_command(struct nand_chip *chip, unsigned int command,
 		 */
 		if (column == -1 && page_addr == -1)
 			return;
+		/* fall through */
 
 	default:
 		/*
@@ -483,7 +484,7 @@ static void nand_command_lp(struct nand_chip *chip, unsigned int command,
 		chip->legacy.cmd_ctrl(chip, NAND_CMD_NONE,
 				      NAND_NCE | NAND_CTRL_CHANGE);
 
-		/* This applies to read commands */
+		/* fall through - This applies to read commands */
 	default:
 		/*
 		 * If we don't have access to the busy pin, we apply the given
diff --git a/drivers/mtd/nand/raw/nandsim.c b/drivers/mtd/nand/raw/nandsim.c
index 933d1a629c51..d33e15dc4cdc 100644
--- a/drivers/mtd/nand/raw/nandsim.c
+++ b/drivers/mtd/nand/raw/nandsim.c
@@ -2251,9 +2251,10 @@ static int __init ns_init_module(void)
 
 	switch (bbt) {
 	case 2:
-		 chip->bbt_options |= NAND_BBT_NO_OOB;
+		chip->bbt_options |= NAND_BBT_NO_OOB;
+		/* fall through */
 	case 1:
-		 chip->bbt_options |= NAND_BBT_USE_FLASH;
+		chip->bbt_options |= NAND_BBT_USE_FLASH;
 	case 0:
 		break;
 	default:
diff --git a/drivers/mtd/nand/raw/nuc900_nand.c b/drivers/mtd/nand/raw/nuc900_nand.c
index 38b1994e7ed3..56fa84029482 100644
--- a/drivers/mtd/nand/raw/nuc900_nand.c
+++ b/drivers/mtd/nand/raw/nuc900_nand.c
@@ -192,8 +192,9 @@ static void nuc900_nand_command_lp(struct nand_chip *chip,
 		return;
 
 	case NAND_CMD_READ0:
-
 		write_cmd_reg(nand, NAND_CMD_READSTART);
+		/* fall through */
+
 	default:
 
 		if (!chip->legacy.dev_ready) {
diff --git a/drivers/mtd/nand/raw/omap_elm.c b/drivers/mtd/nand/raw/omap_elm.c
index a3f32f939cc1..94c6401ef32f 100644
--- a/drivers/mtd/nand/raw/omap_elm.c
+++ b/drivers/mtd/nand/raw/omap_elm.c
@@ -465,11 +465,13 @@ static int elm_context_save(struct elm_info *info)
 					ELM_SYNDROME_FRAGMENT_5 + offset);
 			regs->elm_syndrome_fragment_4[i] = elm_read_reg(info,
 					ELM_SYNDROME_FRAGMENT_4 + offset);
+			/* fall through */
 		case BCH8_ECC:
 			regs->elm_syndrome_fragment_3[i] = elm_read_reg(info,
 					ELM_SYNDROME_FRAGMENT_3 + offset);
 			regs->elm_syndrome_fragment_2[i] = elm_read_reg(info,
 					ELM_SYNDROME_FRAGMENT_2 + offset);
+			/* fall through */
 		case BCH4_ECC:
 			regs->elm_syndrome_fragment_1[i] = elm_read_reg(info,
 					ELM_SYNDROME_FRAGMENT_1 + offset);
@@ -511,11 +513,13 @@ static int elm_context_restore(struct elm_info *info)
 					regs->elm_syndrome_fragment_5[i]);
 			elm_write_reg(info, ELM_SYNDROME_FRAGMENT_4 + offset,
 					regs->elm_syndrome_fragment_4[i]);
+			/* fall through */
 		case BCH8_ECC:
 			elm_write_reg(info, ELM_SYNDROME_FRAGMENT_3 + offset,
 					regs->elm_syndrome_fragment_3[i]);
 			elm_write_reg(info, ELM_SYNDROME_FRAGMENT_2 + offset,
 					regs->elm_syndrome_fragment_2[i]);
+			/* fall through */
 		case BCH4_ECC:
 			elm_write_reg(info, ELM_SYNDROME_FRAGMENT_1 + offset,
 					regs->elm_syndrome_fragment_1[i]);
-- 
2.20.1


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

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH] mtd: rawnand: mark expected switch fall-throughs
@ 2019-01-25 21:09 ` Gustavo A. R. Silva
  0 siblings, 0 replies; 18+ messages in thread
From: Gustavo A. R. Silva @ 2019-01-25 21:09 UTC (permalink / raw)
  To: Kyungmin Park, Boris Brezillon, Miquel Raynal,
	Richard Weinberger, David Woodhouse, Brian Norris, Marek Vasut,
	Wan ZongShun
  Cc: Kees Cook, linux-mtd, linux-kernel, linux-arm-kernel,
	Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch
cases where we are expecting to fall through.

This patch fixes the following warning:

drivers/mtd/nand/onenand/onenand_base.c:3264:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/onenand/onenand_base.c:3288:17: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/nand_base.c:5538:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/nand_base.c:5557:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/nand_base.c:5595:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/nand_legacy.c:332:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/nand_legacy.c:483:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/nandsim.c:2254:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/omap_elm.c:512:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/omap_elm.c:517:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/omap_elm.c:466:37: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/omap_elm.c:471:37: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mtd/nand/raw/nuc900_nand.c: In function ‘nuc900_nand_command_lp’:
./arch/x86/include/asm/io.h:91:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
 #define __raw_writel __writel
drivers/mtd/nand/raw/nuc900_nand.c:52:2: note: in expansion of macro ‘__raw_writel’
  __raw_writel((val), (dev)->reg + REG_SMCMD)
  ^~~~~~~~~~~~
drivers/mtd/nand/raw/nuc900_nand.c:196:3: note: in expansion of macro ‘write_cmd_reg’
   write_cmd_reg(nand, NAND_CMD_READSTART);
   ^~~~~~~~~~~~~
drivers/mtd/nand/raw/nuc900_nand.c:197:2: note: here
  default:
  ^~~~~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

This patch is part of the ongoing efforts to enabling
-Wimplicit-fallthrough.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/mtd/nand/onenand/onenand_base.c | 2 ++
 drivers/mtd/nand/raw/diskonchip.c       | 1 +
 drivers/mtd/nand/raw/nand_base.c        | 3 +++
 drivers/mtd/nand/raw/nand_legacy.c      | 3 ++-
 drivers/mtd/nand/raw/nandsim.c          | 5 +++--
 drivers/mtd/nand/raw/nuc900_nand.c      | 3 ++-
 drivers/mtd/nand/raw/omap_elm.c         | 4 ++++
 7 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/onenand/onenand_base.c b/drivers/mtd/nand/onenand/onenand_base.c
index 4ca4b194e7d7..e9b71ad24f50 100644
--- a/drivers/mtd/nand/onenand/onenand_base.c
+++ b/drivers/mtd/nand/onenand/onenand_base.c
@@ -3280,12 +3280,14 @@ static void onenand_check_features(struct mtd_info *mtd)
 			if ((this->version_id & 0xf) == 0xe)
 				this->options |= ONENAND_HAS_NOP_1;
 		}
+		/* fall through */
 
 	case ONENAND_DEVICE_DENSITY_2Gb:
 		/* 2Gb DDP does not have 2 plane */
 		if (!ONENAND_IS_DDP(this))
 			this->options |= ONENAND_HAS_2PLANE;
 		this->options |= ONENAND_HAS_UNLOCK_ALL;
+		/* fall through */
 
 	case ONENAND_DEVICE_DENSITY_1Gb:
 		/* A-Die has all block unlock */
diff --git a/drivers/mtd/nand/raw/diskonchip.c b/drivers/mtd/nand/raw/diskonchip.c
index 53f57e0f007e..ead54c90f2d1 100644
--- a/drivers/mtd/nand/raw/diskonchip.c
+++ b/drivers/mtd/nand/raw/diskonchip.c
@@ -1477,6 +1477,7 @@ static int __init doc_probe(unsigned long physadr)
 			break;
 		case DOC_ChipID_DocMilPlus32:
 			pr_err("DiskOnChip Millennium Plus 32MB is not supported, ignoring.\n");
+			/* fall through */
 		default:
 			ret = -ENODEV;
 			goto notfound;
diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
index 96cadead262e..e05ecf2e4269 100644
--- a/drivers/mtd/nand/raw/nand_base.c
+++ b/drivers/mtd/nand/raw/nand_base.c
@@ -5537,6 +5537,7 @@ static int nand_scan_tail(struct nand_chip *chip)
 		}
 		if (!ecc->read_page)
 			ecc->read_page = nand_read_page_hwecc_oob_first;
+		/* fall through */
 
 	case NAND_ECC_HW:
 		/* Use standard hwecc read page function? */
@@ -5556,6 +5557,7 @@ static int nand_scan_tail(struct nand_chip *chip)
 			ecc->read_subpage = nand_read_subpage;
 		if (!ecc->write_subpage && ecc->hwctl && ecc->calculate)
 			ecc->write_subpage = nand_write_subpage_hwecc;
+		/* fall through */
 
 	case NAND_ECC_HW_SYNDROME:
 		if ((!ecc->calculate || !ecc->correct || !ecc->hwctl) &&
@@ -5593,6 +5595,7 @@ static int nand_scan_tail(struct nand_chip *chip)
 			ecc->size, mtd->writesize);
 		ecc->mode = NAND_ECC_SOFT;
 		ecc->algo = NAND_ECC_HAMMING;
+		/* fall through */
 
 	case NAND_ECC_SOFT:
 		ret = nand_set_ecc_soft_ops(chip);
diff --git a/drivers/mtd/nand/raw/nand_legacy.c b/drivers/mtd/nand/raw/nand_legacy.c
index 43575943f13b..f2526ec616a6 100644
--- a/drivers/mtd/nand/raw/nand_legacy.c
+++ b/drivers/mtd/nand/raw/nand_legacy.c
@@ -331,6 +331,7 @@ static void nand_command(struct nand_chip *chip, unsigned int command,
 		 */
 		if (column == -1 && page_addr == -1)
 			return;
+		/* fall through */
 
 	default:
 		/*
@@ -483,7 +484,7 @@ static void nand_command_lp(struct nand_chip *chip, unsigned int command,
 		chip->legacy.cmd_ctrl(chip, NAND_CMD_NONE,
 				      NAND_NCE | NAND_CTRL_CHANGE);
 
-		/* This applies to read commands */
+		/* fall through - This applies to read commands */
 	default:
 		/*
 		 * If we don't have access to the busy pin, we apply the given
diff --git a/drivers/mtd/nand/raw/nandsim.c b/drivers/mtd/nand/raw/nandsim.c
index 933d1a629c51..d33e15dc4cdc 100644
--- a/drivers/mtd/nand/raw/nandsim.c
+++ b/drivers/mtd/nand/raw/nandsim.c
@@ -2251,9 +2251,10 @@ static int __init ns_init_module(void)
 
 	switch (bbt) {
 	case 2:
-		 chip->bbt_options |= NAND_BBT_NO_OOB;
+		chip->bbt_options |= NAND_BBT_NO_OOB;
+		/* fall through */
 	case 1:
-		 chip->bbt_options |= NAND_BBT_USE_FLASH;
+		chip->bbt_options |= NAND_BBT_USE_FLASH;
 	case 0:
 		break;
 	default:
diff --git a/drivers/mtd/nand/raw/nuc900_nand.c b/drivers/mtd/nand/raw/nuc900_nand.c
index 38b1994e7ed3..56fa84029482 100644
--- a/drivers/mtd/nand/raw/nuc900_nand.c
+++ b/drivers/mtd/nand/raw/nuc900_nand.c
@@ -192,8 +192,9 @@ static void nuc900_nand_command_lp(struct nand_chip *chip,
 		return;
 
 	case NAND_CMD_READ0:
-
 		write_cmd_reg(nand, NAND_CMD_READSTART);
+		/* fall through */
+
 	default:
 
 		if (!chip->legacy.dev_ready) {
diff --git a/drivers/mtd/nand/raw/omap_elm.c b/drivers/mtd/nand/raw/omap_elm.c
index a3f32f939cc1..94c6401ef32f 100644
--- a/drivers/mtd/nand/raw/omap_elm.c
+++ b/drivers/mtd/nand/raw/omap_elm.c
@@ -465,11 +465,13 @@ static int elm_context_save(struct elm_info *info)
 					ELM_SYNDROME_FRAGMENT_5 + offset);
 			regs->elm_syndrome_fragment_4[i] = elm_read_reg(info,
 					ELM_SYNDROME_FRAGMENT_4 + offset);
+			/* fall through */
 		case BCH8_ECC:
 			regs->elm_syndrome_fragment_3[i] = elm_read_reg(info,
 					ELM_SYNDROME_FRAGMENT_3 + offset);
 			regs->elm_syndrome_fragment_2[i] = elm_read_reg(info,
 					ELM_SYNDROME_FRAGMENT_2 + offset);
+			/* fall through */
 		case BCH4_ECC:
 			regs->elm_syndrome_fragment_1[i] = elm_read_reg(info,
 					ELM_SYNDROME_FRAGMENT_1 + offset);
@@ -511,11 +513,13 @@ static int elm_context_restore(struct elm_info *info)
 					regs->elm_syndrome_fragment_5[i]);
 			elm_write_reg(info, ELM_SYNDROME_FRAGMENT_4 + offset,
 					regs->elm_syndrome_fragment_4[i]);
+			/* fall through */
 		case BCH8_ECC:
 			elm_write_reg(info, ELM_SYNDROME_FRAGMENT_3 + offset,
 					regs->elm_syndrome_fragment_3[i]);
 			elm_write_reg(info, ELM_SYNDROME_FRAGMENT_2 + offset,
 					regs->elm_syndrome_fragment_2[i]);
+			/* fall through */
 		case BCH4_ECC:
 			elm_write_reg(info, ELM_SYNDROME_FRAGMENT_1 + offset,
 					regs->elm_syndrome_fragment_1[i]);
-- 
2.20.1


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

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH] mtd: rawnand: mark expected switch fall-throughs
  2019-01-25 21:09 ` Gustavo A. R. Silva
  (?)
@ 2019-01-26  9:52   ` Boris Brezillon
  -1 siblings, 0 replies; 18+ messages in thread
From: Boris Brezillon @ 2019-01-26  9:52 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Kyungmin Park, Miquel Raynal, Richard Weinberger,
	David Woodhouse, Brian Norris, Marek Vasut, Wan ZongShun,
	linux-mtd, linux-kernel, linux-arm-kernel, Kees Cook

On Fri, 25 Jan 2019 15:09:50 -0600
"Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:

> diff --git a/drivers/mtd/nand/raw/nandsim.c b/drivers/mtd/nand/raw/nandsim.c
> index 933d1a629c51..d33e15dc4cdc 100644
> --- a/drivers/mtd/nand/raw/nandsim.c
> +++ b/drivers/mtd/nand/raw/nandsim.c
> @@ -2251,9 +2251,10 @@ static int __init ns_init_module(void)
>  
>  	switch (bbt) {
>  	case 2:
> -		 chip->bbt_options |= NAND_BBT_NO_OOB;
> +		chip->bbt_options |= NAND_BBT_NO_OOB;
> +		/* fall through */
>  	case 1:
> -		 chip->bbt_options |= NAND_BBT_USE_FLASH;
> +		chip->bbt_options |= NAND_BBT_USE_FLASH;

You miss a '/* fall through */' here.

>  	case 0:
>  		break;
>  	default:

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] mtd: rawnand: mark expected switch fall-throughs
@ 2019-01-26  9:52   ` Boris Brezillon
  0 siblings, 0 replies; 18+ messages in thread
From: Boris Brezillon @ 2019-01-26  9:52 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Kees Cook, Wan ZongShun, Richard Weinberger, linux-kernel,
	Marek Vasut, Kyungmin Park, linux-mtd, Miquel Raynal,
	Brian Norris, David Woodhouse, linux-arm-kernel

On Fri, 25 Jan 2019 15:09:50 -0600
"Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:

> diff --git a/drivers/mtd/nand/raw/nandsim.c b/drivers/mtd/nand/raw/nandsim.c
> index 933d1a629c51..d33e15dc4cdc 100644
> --- a/drivers/mtd/nand/raw/nandsim.c
> +++ b/drivers/mtd/nand/raw/nandsim.c
> @@ -2251,9 +2251,10 @@ static int __init ns_init_module(void)
>  
>  	switch (bbt) {
>  	case 2:
> -		 chip->bbt_options |= NAND_BBT_NO_OOB;
> +		chip->bbt_options |= NAND_BBT_NO_OOB;
> +		/* fall through */
>  	case 1:
> -		 chip->bbt_options |= NAND_BBT_USE_FLASH;
> +		chip->bbt_options |= NAND_BBT_USE_FLASH;

You miss a '/* fall through */' here.

>  	case 0:
>  		break;
>  	default:

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] mtd: rawnand: mark expected switch fall-throughs
@ 2019-01-26  9:52   ` Boris Brezillon
  0 siblings, 0 replies; 18+ messages in thread
From: Boris Brezillon @ 2019-01-26  9:52 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Kees Cook, Wan ZongShun, Richard Weinberger, linux-kernel,
	Marek Vasut, Kyungmin Park, linux-mtd, Miquel Raynal,
	Brian Norris, David Woodhouse, linux-arm-kernel

On Fri, 25 Jan 2019 15:09:50 -0600
"Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:

> diff --git a/drivers/mtd/nand/raw/nandsim.c b/drivers/mtd/nand/raw/nandsim.c
> index 933d1a629c51..d33e15dc4cdc 100644
> --- a/drivers/mtd/nand/raw/nandsim.c
> +++ b/drivers/mtd/nand/raw/nandsim.c
> @@ -2251,9 +2251,10 @@ static int __init ns_init_module(void)
>  
>  	switch (bbt) {
>  	case 2:
> -		 chip->bbt_options |= NAND_BBT_NO_OOB;
> +		chip->bbt_options |= NAND_BBT_NO_OOB;
> +		/* fall through */
>  	case 1:
> -		 chip->bbt_options |= NAND_BBT_USE_FLASH;
> +		chip->bbt_options |= NAND_BBT_USE_FLASH;

You miss a '/* fall through */' here.

>  	case 0:
>  		break;
>  	default:

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] mtd: rawnand: mark expected switch fall-throughs
  2019-01-26  9:52   ` Boris Brezillon
  (?)
@ 2019-01-26 13:48     ` Gustavo A. R. Silva
  -1 siblings, 0 replies; 18+ messages in thread
From: Gustavo A. R. Silva @ 2019-01-26 13:48 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Kyungmin Park, Miquel Raynal, Richard Weinberger,
	David Woodhouse, Brian Norris, Marek Vasut, Wan ZongShun,
	linux-mtd, linux-kernel, linux-arm-kernel, Kees Cook

Hey Boris,

On 1/26/19 3:52 AM, Boris Brezillon wrote:
> On Fri, 25 Jan 2019 15:09:50 -0600
> "Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:
> 
>> diff --git a/drivers/mtd/nand/raw/nandsim.c b/drivers/mtd/nand/raw/nandsim.c
>> index 933d1a629c51..d33e15dc4cdc 100644
>> --- a/drivers/mtd/nand/raw/nandsim.c
>> +++ b/drivers/mtd/nand/raw/nandsim.c
>> @@ -2251,9 +2251,10 @@ static int __init ns_init_module(void)
>>  
>>  	switch (bbt) {
>>  	case 2:
>> -		 chip->bbt_options |= NAND_BBT_NO_OOB;
>> +		chip->bbt_options |= NAND_BBT_NO_OOB;
>> +		/* fall through */
>>  	case 1:
>> -		 chip->bbt_options |= NAND_BBT_USE_FLASH;
>> +		chip->bbt_options |= NAND_BBT_USE_FLASH;
> 
> You miss a '/* fall through */' here.
> 

Not really.  Notice that in this case the code falls through
to a break statement.

>>  	case 0:
>>  		break;
>>  	default:

Thanks
--
Gustavo

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] mtd: rawnand: mark expected switch fall-throughs
@ 2019-01-26 13:48     ` Gustavo A. R. Silva
  0 siblings, 0 replies; 18+ messages in thread
From: Gustavo A. R. Silva @ 2019-01-26 13:48 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Kees Cook, Wan ZongShun, Richard Weinberger, linux-kernel,
	Marek Vasut, Kyungmin Park, linux-mtd, Miquel Raynal,
	Brian Norris, David Woodhouse, linux-arm-kernel

Hey Boris,

On 1/26/19 3:52 AM, Boris Brezillon wrote:
> On Fri, 25 Jan 2019 15:09:50 -0600
> "Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:
> 
>> diff --git a/drivers/mtd/nand/raw/nandsim.c b/drivers/mtd/nand/raw/nandsim.c
>> index 933d1a629c51..d33e15dc4cdc 100644
>> --- a/drivers/mtd/nand/raw/nandsim.c
>> +++ b/drivers/mtd/nand/raw/nandsim.c
>> @@ -2251,9 +2251,10 @@ static int __init ns_init_module(void)
>>  
>>  	switch (bbt) {
>>  	case 2:
>> -		 chip->bbt_options |= NAND_BBT_NO_OOB;
>> +		chip->bbt_options |= NAND_BBT_NO_OOB;
>> +		/* fall through */
>>  	case 1:
>> -		 chip->bbt_options |= NAND_BBT_USE_FLASH;
>> +		chip->bbt_options |= NAND_BBT_USE_FLASH;
> 
> You miss a '/* fall through */' here.
> 

Not really.  Notice that in this case the code falls through
to a break statement.

>>  	case 0:
>>  		break;
>>  	default:

Thanks
--
Gustavo

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] mtd: rawnand: mark expected switch fall-throughs
@ 2019-01-26 13:48     ` Gustavo A. R. Silva
  0 siblings, 0 replies; 18+ messages in thread
From: Gustavo A. R. Silva @ 2019-01-26 13:48 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Kees Cook, Wan ZongShun, Richard Weinberger, linux-kernel,
	Marek Vasut, Kyungmin Park, linux-mtd, Miquel Raynal,
	Brian Norris, David Woodhouse, linux-arm-kernel

Hey Boris,

On 1/26/19 3:52 AM, Boris Brezillon wrote:
> On Fri, 25 Jan 2019 15:09:50 -0600
> "Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:
> 
>> diff --git a/drivers/mtd/nand/raw/nandsim.c b/drivers/mtd/nand/raw/nandsim.c
>> index 933d1a629c51..d33e15dc4cdc 100644
>> --- a/drivers/mtd/nand/raw/nandsim.c
>> +++ b/drivers/mtd/nand/raw/nandsim.c
>> @@ -2251,9 +2251,10 @@ static int __init ns_init_module(void)
>>  
>>  	switch (bbt) {
>>  	case 2:
>> -		 chip->bbt_options |= NAND_BBT_NO_OOB;
>> +		chip->bbt_options |= NAND_BBT_NO_OOB;
>> +		/* fall through */
>>  	case 1:
>> -		 chip->bbt_options |= NAND_BBT_USE_FLASH;
>> +		chip->bbt_options |= NAND_BBT_USE_FLASH;
> 
> You miss a '/* fall through */' here.
> 

Not really.  Notice that in this case the code falls through
to a break statement.

>>  	case 0:
>>  		break;
>>  	default:

Thanks
--
Gustavo

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] mtd: rawnand: mark expected switch fall-throughs
  2019-01-26 13:48     ` Gustavo A. R. Silva
  (?)
@ 2019-01-26 16:54       ` Boris Brezillon
  -1 siblings, 0 replies; 18+ messages in thread
From: Boris Brezillon @ 2019-01-26 16:54 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Kees Cook, Wan ZongShun, Richard Weinberger, linux-kernel,
	Marek Vasut, Kyungmin Park, linux-mtd, Miquel Raynal,
	Brian Norris, David Woodhouse, linux-arm-kernel

On Sat, 26 Jan 2019 07:48:50 -0600
"Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:

> Hey Boris,
> 
> On 1/26/19 3:52 AM, Boris Brezillon wrote:
> > On Fri, 25 Jan 2019 15:09:50 -0600
> > "Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:
> >   
> >> diff --git a/drivers/mtd/nand/raw/nandsim.c b/drivers/mtd/nand/raw/nandsim.c
> >> index 933d1a629c51..d33e15dc4cdc 100644
> >> --- a/drivers/mtd/nand/raw/nandsim.c
> >> +++ b/drivers/mtd/nand/raw/nandsim.c
> >> @@ -2251,9 +2251,10 @@ static int __init ns_init_module(void)
> >>  
> >>  	switch (bbt) {
> >>  	case 2:
> >> -		 chip->bbt_options |= NAND_BBT_NO_OOB;
> >> +		chip->bbt_options |= NAND_BBT_NO_OOB;
> >> +		/* fall through */
> >>  	case 1:
> >> -		 chip->bbt_options |= NAND_BBT_USE_FLASH;
> >> +		chip->bbt_options |= NAND_BBT_USE_FLASH;  
> > 
> > You miss a '/* fall through */' here.
> >   
> 
> Not really.  Notice that in this case the code falls through
> to a break statement.

Still find it weird to mandate fall through comments in all cases but
this one...

> 
> >>  	case 0:
> >>  		break;
> >>  	default:  
> 
> Thanks
> --
> Gustavo
> 
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] mtd: rawnand: mark expected switch fall-throughs
@ 2019-01-26 16:54       ` Boris Brezillon
  0 siblings, 0 replies; 18+ messages in thread
From: Boris Brezillon @ 2019-01-26 16:54 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Kees Cook, Wan ZongShun, Richard Weinberger, linux-kernel,
	Marek Vasut, Kyungmin Park, linux-mtd, Miquel Raynal,
	Brian Norris, David Woodhouse, linux-arm-kernel

On Sat, 26 Jan 2019 07:48:50 -0600
"Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:

> Hey Boris,
> 
> On 1/26/19 3:52 AM, Boris Brezillon wrote:
> > On Fri, 25 Jan 2019 15:09:50 -0600
> > "Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:
> >   
> >> diff --git a/drivers/mtd/nand/raw/nandsim.c b/drivers/mtd/nand/raw/nandsim.c
> >> index 933d1a629c51..d33e15dc4cdc 100644
> >> --- a/drivers/mtd/nand/raw/nandsim.c
> >> +++ b/drivers/mtd/nand/raw/nandsim.c
> >> @@ -2251,9 +2251,10 @@ static int __init ns_init_module(void)
> >>  
> >>  	switch (bbt) {
> >>  	case 2:
> >> -		 chip->bbt_options |= NAND_BBT_NO_OOB;
> >> +		chip->bbt_options |= NAND_BBT_NO_OOB;
> >> +		/* fall through */
> >>  	case 1:
> >> -		 chip->bbt_options |= NAND_BBT_USE_FLASH;
> >> +		chip->bbt_options |= NAND_BBT_USE_FLASH;  
> > 
> > You miss a '/* fall through */' here.
> >   
> 
> Not really.  Notice that in this case the code falls through
> to a break statement.

Still find it weird to mandate fall through comments in all cases but
this one...

> 
> >>  	case 0:
> >>  		break;
> >>  	default:  
> 
> Thanks
> --
> Gustavo
> 
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/


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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] mtd: rawnand: mark expected switch fall-throughs
@ 2019-01-26 16:54       ` Boris Brezillon
  0 siblings, 0 replies; 18+ messages in thread
From: Boris Brezillon @ 2019-01-26 16:54 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Kees Cook, Wan ZongShun, Richard Weinberger, linux-kernel,
	Marek Vasut, Kyungmin Park, linux-mtd, Miquel Raynal,
	Brian Norris, David Woodhouse, linux-arm-kernel

On Sat, 26 Jan 2019 07:48:50 -0600
"Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:

> Hey Boris,
> 
> On 1/26/19 3:52 AM, Boris Brezillon wrote:
> > On Fri, 25 Jan 2019 15:09:50 -0600
> > "Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:
> >   
> >> diff --git a/drivers/mtd/nand/raw/nandsim.c b/drivers/mtd/nand/raw/nandsim.c
> >> index 933d1a629c51..d33e15dc4cdc 100644
> >> --- a/drivers/mtd/nand/raw/nandsim.c
> >> +++ b/drivers/mtd/nand/raw/nandsim.c
> >> @@ -2251,9 +2251,10 @@ static int __init ns_init_module(void)
> >>  
> >>  	switch (bbt) {
> >>  	case 2:
> >> -		 chip->bbt_options |= NAND_BBT_NO_OOB;
> >> +		chip->bbt_options |= NAND_BBT_NO_OOB;
> >> +		/* fall through */
> >>  	case 1:
> >> -		 chip->bbt_options |= NAND_BBT_USE_FLASH;
> >> +		chip->bbt_options |= NAND_BBT_USE_FLASH;  
> > 
> > You miss a '/* fall through */' here.
> >   
> 
> Not really.  Notice that in this case the code falls through
> to a break statement.

Still find it weird to mandate fall through comments in all cases but
this one...

> 
> >>  	case 0:
> >>  		break;
> >>  	default:  
> 
> Thanks
> --
> Gustavo
> 
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/


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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] mtd: rawnand: mark expected switch fall-throughs
  2019-01-26 16:54       ` Boris Brezillon
  (?)
@ 2019-01-28  9:13         ` Miquel Raynal
  -1 siblings, 0 replies; 18+ messages in thread
From: Miquel Raynal @ 2019-01-28  9:13 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Gustavo A. R. Silva, Kees Cook, Wan ZongShun, Richard Weinberger,
	linux-kernel, Marek Vasut, Kyungmin Park, linux-mtd,
	Brian Norris, David Woodhouse, linux-arm-kernel

Hi Boris,

Boris Brezillon <bbrezillon@kernel.org> wrote on Sat, 26 Jan 2019
17:54:29 +0100:

> On Sat, 26 Jan 2019 07:48:50 -0600
> "Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:
> 
> > Hey Boris,
> > 
> > On 1/26/19 3:52 AM, Boris Brezillon wrote:  
> > > On Fri, 25 Jan 2019 15:09:50 -0600
> > > "Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:
> > >     
> > >> diff --git a/drivers/mtd/nand/raw/nandsim.c b/drivers/mtd/nand/raw/nandsim.c
> > >> index 933d1a629c51..d33e15dc4cdc 100644
> > >> --- a/drivers/mtd/nand/raw/nandsim.c
> > >> +++ b/drivers/mtd/nand/raw/nandsim.c
> > >> @@ -2251,9 +2251,10 @@ static int __init ns_init_module(void)
> > >>  
> > >>  	switch (bbt) {
> > >>  	case 2:
> > >> -		 chip->bbt_options |= NAND_BBT_NO_OOB;
> > >> +		chip->bbt_options |= NAND_BBT_NO_OOB;
> > >> +		/* fall through */
> > >>  	case 1:
> > >> -		 chip->bbt_options |= NAND_BBT_USE_FLASH;
> > >> +		chip->bbt_options |= NAND_BBT_USE_FLASH;    
> > > 
> > > You miss a '/* fall through */' here.
> > >     
> > 
> > Not really.  Notice that in this case the code falls through
> > to a break statement.  
> 
> Still find it weird to mandate fall through comments in all cases but
> this one...

Yes please, even if there is no GCC warning I think you can add one
here.


Thanks,
Miquèl

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] mtd: rawnand: mark expected switch fall-throughs
@ 2019-01-28  9:13         ` Miquel Raynal
  0 siblings, 0 replies; 18+ messages in thread
From: Miquel Raynal @ 2019-01-28  9:13 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Kees Cook, Wan ZongShun, Gustavo A. R. Silva, Richard Weinberger,
	linux-kernel, Marek Vasut, Kyungmin Park, linux-mtd,
	Brian Norris, David Woodhouse, linux-arm-kernel

Hi Boris,

Boris Brezillon <bbrezillon@kernel.org> wrote on Sat, 26 Jan 2019
17:54:29 +0100:

> On Sat, 26 Jan 2019 07:48:50 -0600
> "Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:
> 
> > Hey Boris,
> > 
> > On 1/26/19 3:52 AM, Boris Brezillon wrote:  
> > > On Fri, 25 Jan 2019 15:09:50 -0600
> > > "Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:
> > >     
> > >> diff --git a/drivers/mtd/nand/raw/nandsim.c b/drivers/mtd/nand/raw/nandsim.c
> > >> index 933d1a629c51..d33e15dc4cdc 100644
> > >> --- a/drivers/mtd/nand/raw/nandsim.c
> > >> +++ b/drivers/mtd/nand/raw/nandsim.c
> > >> @@ -2251,9 +2251,10 @@ static int __init ns_init_module(void)
> > >>  
> > >>  	switch (bbt) {
> > >>  	case 2:
> > >> -		 chip->bbt_options |= NAND_BBT_NO_OOB;
> > >> +		chip->bbt_options |= NAND_BBT_NO_OOB;
> > >> +		/* fall through */
> > >>  	case 1:
> > >> -		 chip->bbt_options |= NAND_BBT_USE_FLASH;
> > >> +		chip->bbt_options |= NAND_BBT_USE_FLASH;    
> > > 
> > > You miss a '/* fall through */' here.
> > >     
> > 
> > Not really.  Notice that in this case the code falls through
> > to a break statement.  
> 
> Still find it weird to mandate fall through comments in all cases but
> this one...

Yes please, even if there is no GCC warning I think you can add one
here.


Thanks,
Miquèl

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] mtd: rawnand: mark expected switch fall-throughs
@ 2019-01-28  9:13         ` Miquel Raynal
  0 siblings, 0 replies; 18+ messages in thread
From: Miquel Raynal @ 2019-01-28  9:13 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Kees Cook, Wan ZongShun, Gustavo A. R. Silva, Richard Weinberger,
	linux-kernel, Marek Vasut, Kyungmin Park, linux-mtd,
	Brian Norris, David Woodhouse, linux-arm-kernel

Hi Boris,

Boris Brezillon <bbrezillon@kernel.org> wrote on Sat, 26 Jan 2019
17:54:29 +0100:

> On Sat, 26 Jan 2019 07:48:50 -0600
> "Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:
> 
> > Hey Boris,
> > 
> > On 1/26/19 3:52 AM, Boris Brezillon wrote:  
> > > On Fri, 25 Jan 2019 15:09:50 -0600
> > > "Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:
> > >     
> > >> diff --git a/drivers/mtd/nand/raw/nandsim.c b/drivers/mtd/nand/raw/nandsim.c
> > >> index 933d1a629c51..d33e15dc4cdc 100644
> > >> --- a/drivers/mtd/nand/raw/nandsim.c
> > >> +++ b/drivers/mtd/nand/raw/nandsim.c
> > >> @@ -2251,9 +2251,10 @@ static int __init ns_init_module(void)
> > >>  
> > >>  	switch (bbt) {
> > >>  	case 2:
> > >> -		 chip->bbt_options |= NAND_BBT_NO_OOB;
> > >> +		chip->bbt_options |= NAND_BBT_NO_OOB;
> > >> +		/* fall through */
> > >>  	case 1:
> > >> -		 chip->bbt_options |= NAND_BBT_USE_FLASH;
> > >> +		chip->bbt_options |= NAND_BBT_USE_FLASH;    
> > > 
> > > You miss a '/* fall through */' here.
> > >     
> > 
> > Not really.  Notice that in this case the code falls through
> > to a break statement.  
> 
> Still find it weird to mandate fall through comments in all cases but
> this one...

Yes please, even if there is no GCC warning I think you can add one
here.


Thanks,
Miquèl

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] mtd: rawnand: mark expected switch fall-throughs
  2019-01-28  9:13         ` Miquel Raynal
  (?)
@ 2019-01-28 18:23           ` Gustavo A. R. Silva
  -1 siblings, 0 replies; 18+ messages in thread
From: Gustavo A. R. Silva @ 2019-01-28 18:23 UTC (permalink / raw)
  To: Miquel Raynal, Boris Brezillon
  Cc: Kees Cook, Wan ZongShun, Richard Weinberger, linux-kernel,
	Marek Vasut, Kyungmin Park, linux-mtd, Brian Norris,
	David Woodhouse, linux-arm-kernel

Miquel, Boris,

On 1/28/19 3:13 AM, Miquel Raynal wrote:
> Hi Boris,
> 
> Boris Brezillon <bbrezillon@kernel.org> wrote on Sat, 26 Jan 2019
> 17:54:29 +0100:
> 
>> On Sat, 26 Jan 2019 07:48:50 -0600
>> "Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:
>>
>>> Hey Boris,
>>>
>>> On 1/26/19 3:52 AM, Boris Brezillon wrote:  
>>>> On Fri, 25 Jan 2019 15:09:50 -0600
>>>> "Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:
>>>>     
>>>>> diff --git a/drivers/mtd/nand/raw/nandsim.c b/drivers/mtd/nand/raw/nandsim.c
>>>>> index 933d1a629c51..d33e15dc4cdc 100644
>>>>> --- a/drivers/mtd/nand/raw/nandsim.c
>>>>> +++ b/drivers/mtd/nand/raw/nandsim.c
>>>>> @@ -2251,9 +2251,10 @@ static int __init ns_init_module(void)
>>>>>  
>>>>>  	switch (bbt) {
>>>>>  	case 2:
>>>>> -		 chip->bbt_options |= NAND_BBT_NO_OOB;
>>>>> +		chip->bbt_options |= NAND_BBT_NO_OOB;
>>>>> +		/* fall through */
>>>>>  	case 1:
>>>>> -		 chip->bbt_options |= NAND_BBT_USE_FLASH;
>>>>> +		chip->bbt_options |= NAND_BBT_USE_FLASH;    
>>>>
>>>> You miss a '/* fall through */' here.
>>>>     
>>>
>>> Not really.  Notice that in this case the code falls through
>>> to a break statement.  
>>
>> Still find it weird to mandate fall through comments in all cases but
>> this one...
> 
> Yes please, even if there is no GCC warning I think you can add one
> here.
> 

Yep. I get your point.

I've just sent v2: https://lore.kernel.org/patchwork/patch/1036251/

Thanks for the feedback.
--
Gustavo

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] mtd: rawnand: mark expected switch fall-throughs
@ 2019-01-28 18:23           ` Gustavo A. R. Silva
  0 siblings, 0 replies; 18+ messages in thread
From: Gustavo A. R. Silva @ 2019-01-28 18:23 UTC (permalink / raw)
  To: Miquel Raynal, Boris Brezillon
  Cc: Kees Cook, Wan ZongShun, Richard Weinberger, linux-kernel,
	Marek Vasut, Kyungmin Park, linux-mtd, Brian Norris,
	David Woodhouse, linux-arm-kernel

Miquel, Boris,

On 1/28/19 3:13 AM, Miquel Raynal wrote:
> Hi Boris,
> 
> Boris Brezillon <bbrezillon@kernel.org> wrote on Sat, 26 Jan 2019
> 17:54:29 +0100:
> 
>> On Sat, 26 Jan 2019 07:48:50 -0600
>> "Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:
>>
>>> Hey Boris,
>>>
>>> On 1/26/19 3:52 AM, Boris Brezillon wrote:  
>>>> On Fri, 25 Jan 2019 15:09:50 -0600
>>>> "Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:
>>>>     
>>>>> diff --git a/drivers/mtd/nand/raw/nandsim.c b/drivers/mtd/nand/raw/nandsim.c
>>>>> index 933d1a629c51..d33e15dc4cdc 100644
>>>>> --- a/drivers/mtd/nand/raw/nandsim.c
>>>>> +++ b/drivers/mtd/nand/raw/nandsim.c
>>>>> @@ -2251,9 +2251,10 @@ static int __init ns_init_module(void)
>>>>>  
>>>>>  	switch (bbt) {
>>>>>  	case 2:
>>>>> -		 chip->bbt_options |= NAND_BBT_NO_OOB;
>>>>> +		chip->bbt_options |= NAND_BBT_NO_OOB;
>>>>> +		/* fall through */
>>>>>  	case 1:
>>>>> -		 chip->bbt_options |= NAND_BBT_USE_FLASH;
>>>>> +		chip->bbt_options |= NAND_BBT_USE_FLASH;    
>>>>
>>>> You miss a '/* fall through */' here.
>>>>     
>>>
>>> Not really.  Notice that in this case the code falls through
>>> to a break statement.  
>>
>> Still find it weird to mandate fall through comments in all cases but
>> this one...
> 
> Yes please, even if there is no GCC warning I think you can add one
> here.
> 

Yep. I get your point.

I've just sent v2: https://lore.kernel.org/patchwork/patch/1036251/

Thanks for the feedback.
--
Gustavo

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] mtd: rawnand: mark expected switch fall-throughs
@ 2019-01-28 18:23           ` Gustavo A. R. Silva
  0 siblings, 0 replies; 18+ messages in thread
From: Gustavo A. R. Silva @ 2019-01-28 18:23 UTC (permalink / raw)
  To: Miquel Raynal, Boris Brezillon
  Cc: Kees Cook, Wan ZongShun, Richard Weinberger, linux-kernel,
	Marek Vasut, Kyungmin Park, linux-mtd, Brian Norris,
	David Woodhouse, linux-arm-kernel

Miquel, Boris,

On 1/28/19 3:13 AM, Miquel Raynal wrote:
> Hi Boris,
> 
> Boris Brezillon <bbrezillon@kernel.org> wrote on Sat, 26 Jan 2019
> 17:54:29 +0100:
> 
>> On Sat, 26 Jan 2019 07:48:50 -0600
>> "Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:
>>
>>> Hey Boris,
>>>
>>> On 1/26/19 3:52 AM, Boris Brezillon wrote:  
>>>> On Fri, 25 Jan 2019 15:09:50 -0600
>>>> "Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:
>>>>     
>>>>> diff --git a/drivers/mtd/nand/raw/nandsim.c b/drivers/mtd/nand/raw/nandsim.c
>>>>> index 933d1a629c51..d33e15dc4cdc 100644
>>>>> --- a/drivers/mtd/nand/raw/nandsim.c
>>>>> +++ b/drivers/mtd/nand/raw/nandsim.c
>>>>> @@ -2251,9 +2251,10 @@ static int __init ns_init_module(void)
>>>>>  
>>>>>  	switch (bbt) {
>>>>>  	case 2:
>>>>> -		 chip->bbt_options |= NAND_BBT_NO_OOB;
>>>>> +		chip->bbt_options |= NAND_BBT_NO_OOB;
>>>>> +		/* fall through */
>>>>>  	case 1:
>>>>> -		 chip->bbt_options |= NAND_BBT_USE_FLASH;
>>>>> +		chip->bbt_options |= NAND_BBT_USE_FLASH;    
>>>>
>>>> You miss a '/* fall through */' here.
>>>>     
>>>
>>> Not really.  Notice that in this case the code falls through
>>> to a break statement.  
>>
>> Still find it weird to mandate fall through comments in all cases but
>> this one...
> 
> Yes please, even if there is no GCC warning I think you can add one
> here.
> 

Yep. I get your point.

I've just sent v2: https://lore.kernel.org/patchwork/patch/1036251/

Thanks for the feedback.
--
Gustavo

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2019-01-28 18:24 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-25 21:09 [PATCH] mtd: rawnand: mark expected switch fall-throughs Gustavo A. R. Silva
2019-01-25 21:09 ` Gustavo A. R. Silva
2019-01-25 21:09 ` Gustavo A. R. Silva
2019-01-26  9:52 ` Boris Brezillon
2019-01-26  9:52   ` Boris Brezillon
2019-01-26  9:52   ` Boris Brezillon
2019-01-26 13:48   ` Gustavo A. R. Silva
2019-01-26 13:48     ` Gustavo A. R. Silva
2019-01-26 13:48     ` Gustavo A. R. Silva
2019-01-26 16:54     ` Boris Brezillon
2019-01-26 16:54       ` Boris Brezillon
2019-01-26 16:54       ` Boris Brezillon
2019-01-28  9:13       ` Miquel Raynal
2019-01-28  9:13         ` Miquel Raynal
2019-01-28  9:13         ` Miquel Raynal
2019-01-28 18:23         ` Gustavo A. R. Silva
2019-01-28 18:23           ` Gustavo A. R. Silva
2019-01-28 18:23           ` Gustavo A. R. Silva

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.