Re: [PATCH] mtd: rawnand: mark expected switch fall-throughs

From
Gustavo A. R. Silva <hidden>
Date
2019-01-28 18:23:42
Also in
lkml
Reply to
Miquel Raynal, 2019-01-28
Miquel, Boris,

On 1/28/19 3:13 AM, Miquel Raynal wrote:
Hi Boris,

Boris Brezillon [off-list ref] wrote on Sat, 26 Jan 2019
17:54:29 +0100:
quoted
On Sat, 26 Jan 2019 07:48:50 -0600
"Gustavo A. R. Silva" [off-list ref] wrote:
quoted
Hey Boris,

On 1/26/19 3:52 AM, Boris Brezillon wrote:  
quoted
On Fri, 25 Jan 2019 15:09:50 -0600
"Gustavo A. R. Silva" [off-list ref] wrote:
    
quoted
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
Thread (6 messages) 6 messages, 3 authors, last reply 2019-01-28
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help