From: Kees Cook <keescook@chromium.org>
To: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: Vignesh Raghavendra <vigneshr@ti.com>,
Richard Weinberger <richard@nod.at>,
Jonathan Bakker <xc-racer2@live.ca>,
linux-kernel@vger.kernel.org, Marek Vasut <marek.vasut@gmail.com>,
Kyungmin Park <kyungmin.park@samsung.com>,
linux-mtd@lists.infradead.org,
Miquel Raynal <miquel.raynal@bootlin.com>,
Brian Norris <computersforpeace@gmail.com>,
David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH] mtd: onenand_base: Mark expected switch fall-through
Date: Tue, 4 Jun 2019 07:45:15 -0700 [thread overview]
Message-ID: <201906040745.B6AE4C6@keescook> (raw)
In-Reply-To: <20190604141737.GA1064@embeddedor>
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
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
WARNING: multiple messages have this Message-ID (diff)
From: Kees Cook <keescook@chromium.org>
To: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
David Woodhouse <dwmw2@infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
Marek Vasut <marek.vasut@gmail.com>,
Vignesh Raghavendra <vigneshr@ti.com>,
Jonathan Bakker <xc-racer2@live.ca>,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mtd: onenand_base: Mark expected switch fall-through
Date: Tue, 4 Jun 2019 07:45:15 -0700 [thread overview]
Message-ID: <201906040745.B6AE4C6@keescook> (raw)
In-Reply-To: <20190604141737.GA1064@embeddedor>
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
next prev parent reply other threads:[~2019-06-04 14:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-04 14:17 [PATCH] mtd: onenand_base: Mark expected switch fall-through Gustavo A. R. Silva
2019-06-04 14:17 ` Gustavo A. R. Silva
2019-06-04 14:45 ` Kees Cook [this message]
2019-06-04 14:45 ` Kees Cook
2019-06-26 18:16 ` Gustavo A. R. Silva
2019-06-26 18:16 ` Gustavo A. R. Silva
2019-06-27 16:45 ` Miquel Raynal
2019-06-27 16:45 ` Miquel Raynal
2019-07-01 7:17 ` Miquel Raynal
2019-07-01 7:17 ` Miquel Raynal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201906040745.B6AE4C6@keescook \
--to=keescook@chromium.org \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=gustavo@embeddedor.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=vigneshr@ti.com \
--cc=xc-racer2@live.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.