linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: onenand_base: Mark expected switch fall-through
@ 2019-06-04 14:17 Gustavo A. R. Silva
  2019-06-04 14:45 ` Kees Cook
  2019-07-01  7:17 ` Miquel Raynal
  0 siblings, 2 replies; 5+ messages in thread
From: Gustavo A. R. Silva @ 2019-06-04 14:17 UTC (permalink / raw)
  To: Kyungmin Park, Miquel Raynal, Richard Weinberger,
	David Woodhouse, Brian Norris, Marek Vasut, Vignesh Raghavendra,
	Jonathan Bakker
  Cc: linux-mtd, linux-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: In function ‘onenand_check_features’:
drivers/mtd/nand/onenand/onenand_base.c:3264:17: warning: this statement may fall through [-Wimplicit-fallthrough=]
   this->options |= ONENAND_HAS_NOP_1;
drivers/mtd/nand/onenand/onenand_base.c:3265:2: note: here
  case ONENAND_DEVICE_DENSITY_4Gb:
  ^~~~

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

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

Cc: Jonathan Bakker <xc-racer2@live.ca>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/mtd/nand/onenand/onenand_base.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/nand/onenand/onenand_base.c b/drivers/mtd/nand/onenand/onenand_base.c
index ba46d0cf60a1..bdb5f4733d28 100644
--- a/drivers/mtd/nand/onenand/onenand_base.c
+++ b/drivers/mtd/nand/onenand/onenand_base.c
@@ -3262,6 +3262,7 @@ static void onenand_check_features(struct mtd_info *mtd)
 	switch (density) {
 	case ONENAND_DEVICE_DENSITY_8Gb:
 		this->options |= ONENAND_HAS_NOP_1;
+		/* fall through */
 	case ONENAND_DEVICE_DENSITY_4Gb:
 		if (ONENAND_IS_DDP(this))
 			this->options |= ONENAND_HAS_2PLANE;
-- 
2.21.0


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

* Re: [PATCH] mtd: onenand_base: Mark expected switch fall-through
  2019-06-04 14:17 [PATCH] mtd: onenand_base: Mark expected switch fall-through Gustavo A. R. Silva
@ 2019-06-04 14:45 ` Kees Cook
  2019-06-26 18:16   ` Gustavo A. R. Silva
  2019-07-01  7:17 ` Miquel Raynal
  1 sibling, 1 reply; 5+ messages in thread
From: Kees Cook @ 2019-06-04 14:45 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Kyungmin Park, Miquel Raynal, Richard Weinberger,
	David Woodhouse, Brian Norris, Marek Vasut, Vignesh Raghavendra,
	Jonathan Bakker, linux-mtd, linux-kernel

On Tue, Jun 04, 2019 at 09:17:37AM -0500, Gustavo A. R. Silva wrote:
> 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: In function ‘onenand_check_features’:
> drivers/mtd/nand/onenand/onenand_base.c:3264:17: warning: this statement may fall through [-Wimplicit-fallthrough=]
>    this->options |= ONENAND_HAS_NOP_1;
> drivers/mtd/nand/onenand/onenand_base.c:3265:2: note: here
>   case ONENAND_DEVICE_DENSITY_4Gb:
>   ^~~~
> 
> Warning level 3 was used: -Wimplicit-fallthrough=3
> 
> This patch is part of the ongoing efforts to enable
> -Wimplicit-fallthrough.
> 
> Cc: Jonathan Bakker <xc-racer2@live.ca>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

Reviewed-by: Kees Cook <keescook@chromium.org>

-Kees

> ---
>  drivers/mtd/nand/onenand/onenand_base.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mtd/nand/onenand/onenand_base.c b/drivers/mtd/nand/onenand/onenand_base.c
> index ba46d0cf60a1..bdb5f4733d28 100644
> --- a/drivers/mtd/nand/onenand/onenand_base.c
> +++ b/drivers/mtd/nand/onenand/onenand_base.c
> @@ -3262,6 +3262,7 @@ static void onenand_check_features(struct mtd_info *mtd)
>  	switch (density) {
>  	case ONENAND_DEVICE_DENSITY_8Gb:
>  		this->options |= ONENAND_HAS_NOP_1;
> +		/* fall through */
>  	case ONENAND_DEVICE_DENSITY_4Gb:
>  		if (ONENAND_IS_DDP(this))
>  			this->options |= ONENAND_HAS_2PLANE;
> -- 
> 2.21.0
> 

-- 
Kees Cook

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

* Re: [PATCH] mtd: onenand_base: Mark expected switch fall-through
  2019-06-04 14:45 ` Kees Cook
@ 2019-06-26 18:16   ` Gustavo A. R. Silva
  2019-06-27 16:45     ` Miquel Raynal
  0 siblings, 1 reply; 5+ messages in thread
From: Gustavo A. R. Silva @ 2019-06-26 18:16 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Kees Cook, Kyungmin Park, Richard Weinberger, David Woodhouse,
	Brian Norris, Marek Vasut, Vignesh Raghavendra, Jonathan Bakker,
	linux-mtd, linux-kernel

Hi all,

Friendly ping:

Who can take this?

Thanks
--
Gustavo

On 6/4/19 9:45 AM, Kees Cook wrote:
> On Tue, Jun 04, 2019 at 09:17:37AM -0500, Gustavo A. R. Silva wrote:
>> 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: In function ‘onenand_check_features’:
>> drivers/mtd/nand/onenand/onenand_base.c:3264:17: warning: this statement may fall through [-Wimplicit-fallthrough=]
>>    this->options |= ONENAND_HAS_NOP_1;
>> drivers/mtd/nand/onenand/onenand_base.c:3265:2: note: here
>>   case ONENAND_DEVICE_DENSITY_4Gb:
>>   ^~~~
>>
>> Warning level 3 was used: -Wimplicit-fallthrough=3
>>
>> This patch is part of the ongoing efforts to enable
>> -Wimplicit-fallthrough.
>>
>> Cc: Jonathan Bakker <xc-racer2@live.ca>
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> 
> Reviewed-by: Kees Cook <keescook@chromium.org>
> 
> -Kees
> 
>> ---
>>  drivers/mtd/nand/onenand/onenand_base.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/mtd/nand/onenand/onenand_base.c b/drivers/mtd/nand/onenand/onenand_base.c
>> index ba46d0cf60a1..bdb5f4733d28 100644
>> --- a/drivers/mtd/nand/onenand/onenand_base.c
>> +++ b/drivers/mtd/nand/onenand/onenand_base.c
>> @@ -3262,6 +3262,7 @@ static void onenand_check_features(struct mtd_info *mtd)
>>  	switch (density) {
>>  	case ONENAND_DEVICE_DENSITY_8Gb:
>>  		this->options |= ONENAND_HAS_NOP_1;
>> +		/* fall through */
>>  	case ONENAND_DEVICE_DENSITY_4Gb:
>>  		if (ONENAND_IS_DDP(this))
>>  			this->options |= ONENAND_HAS_2PLANE;
>> -- 
>> 2.21.0
>>
> 

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

* Re: [PATCH] mtd: onenand_base: Mark expected switch fall-through
  2019-06-26 18:16   ` Gustavo A. R. Silva
@ 2019-06-27 16:45     ` Miquel Raynal
  0 siblings, 0 replies; 5+ messages in thread
From: Miquel Raynal @ 2019-06-27 16:45 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Kees Cook, Kyungmin Park, Richard Weinberger, David Woodhouse,
	Brian Norris, Marek Vasut, Vignesh Raghavendra, Jonathan Bakker,
	linux-mtd, linux-kernel

Hi Gustavo,

"Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote on Wed, 26 Jun
2019 13:16:22 -0500:

> Hi all,
> 
> Friendly ping:
> 
> Who can take this?

I am queuing it right now, please be patient.

Also for next time, the prefix should have been "mtd: onenand:" but
that's ok, I edited the title.


Thanks,
Miquèl

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

* Re: [PATCH] mtd: onenand_base: Mark expected switch fall-through
  2019-06-04 14:17 [PATCH] mtd: onenand_base: Mark expected switch fall-through Gustavo A. R. Silva
  2019-06-04 14:45 ` Kees Cook
@ 2019-07-01  7:17 ` Miquel Raynal
  1 sibling, 0 replies; 5+ messages in thread
From: Miquel Raynal @ 2019-07-01  7:17 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Kyungmin Park, Richard Weinberger, David Woodhouse, Brian Norris,
	Marek Vasut, Vignesh Raghavendra, Jonathan Bakker, linux-mtd,
	linux-kernel, Kees Cook

Hi Gustavo,

"Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote on Tue, 4 Jun 2019
09:17:37 -0500:

> 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: In function ‘onenand_check_features’:
> drivers/mtd/nand/onenand/onenand_base.c:3264:17: warning: this statement may fall through [-Wimplicit-fallthrough=]
>    this->options |= ONENAND_HAS_NOP_1;
> drivers/mtd/nand/onenand/onenand_base.c:3265:2: note: here
>   case ONENAND_DEVICE_DENSITY_4Gb:
>   ^~~~
> 
> Warning level 3 was used: -Wimplicit-fallthrough=3
> 
> This patch is part of the ongoing efforts to enable
> -Wimplicit-fallthrough.
> 
> Cc: Jonathan Bakker <xc-racer2@live.ca>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
>  drivers/mtd/nand/onenand/onenand_base.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mtd/nand/onenand/onenand_base.c b/drivers/mtd/nand/onenand/onenand_base.c
> index ba46d0cf60a1..bdb5f4733d28 100644
> --- a/drivers/mtd/nand/onenand/onenand_base.c
> +++ b/drivers/mtd/nand/onenand/onenand_base.c
> @@ -3262,6 +3262,7 @@ static void onenand_check_features(struct mtd_info *mtd)
>  	switch (density) {
>  	case ONENAND_DEVICE_DENSITY_8Gb:
>  		this->options |= ONENAND_HAS_NOP_1;
> +		/* fall through */
>  	case ONENAND_DEVICE_DENSITY_4Gb:
>  		if (ONENAND_IS_DDP(this))
>  			this->options |= ONENAND_HAS_2PLANE;


Applied to nand/next, thanks.

Miquèl

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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-04 14:17 [PATCH] mtd: onenand_base: Mark expected switch fall-through Gustavo A. R. Silva
2019-06-04 14:45 ` Kees Cook
2019-06-26 18:16   ` Gustavo A. R. Silva
2019-06-27 16:45     ` Miquel Raynal
2019-07-01  7:17 ` Miquel Raynal

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).