All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Boris Brezillon <bbrezillon@kernel.org>,
	Marek Vasut <marek.vasut@gmail.com>,
	Richard Weinberger <richard@nod.at>,
	Linux mtd <linux-mtd@lists.infradead.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mtd: lpddr_cmds: Mark expected switch fall-through
Date: Wed, 10 Apr 2019 14:47:05 -0700	[thread overview]
Message-ID: <CAGXu5j+_CGq=69qAaZz1zYpHx-khRT+VSLtARkU+8txBkdzk2A@mail.gmail.com> (raw)
In-Reply-To: <20190208181210.GA8388@embeddedor>

On Fri, Feb 8, 2019 at 10:12 AM Gustavo A. R. Silva
<gustavo@embeddedor.com> wrote:
>
> In preparation to enabling -Wimplicit-fallthrough, mark switch
> cases where we are expecting to fall through.
>
> This patch fixes the following warnings:
>
> drivers/mtd/lpddr/lpddr_cmds.c: In function ‘chip_ready’:
> drivers/mtd/lpddr/lpddr_cmds.c:319:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
>    if (mode == FL_READY && chip->oldstate == FL_READY)
>       ^
> drivers/mtd/lpddr/lpddr_cmds.c:322: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>

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

-Kees

> ---
>  drivers/mtd/lpddr/lpddr_cmds.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mtd/lpddr/lpddr_cmds.c b/drivers/mtd/lpddr/lpddr_cmds.c
> index b13557fe52bd..76a4c73e100e 100644
> --- a/drivers/mtd/lpddr/lpddr_cmds.c
> +++ b/drivers/mtd/lpddr/lpddr_cmds.c
> @@ -318,6 +318,7 @@ static int chip_ready(struct map_info *map, struct flchip *chip, int mode)
>                 /* Only if there's no operation suspended... */
>                 if (mode == FL_READY && chip->oldstate == FL_READY)
>                         return 0;
> +               /* fall through */
>
>         default:
>  sleep:
> --
> 2.20.1
>


-- 
Kees Cook

WARNING: multiple messages have this Message-ID (diff)
From: Kees Cook <keescook@chromium.org>
To: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: Boris Brezillon <bbrezillon@kernel.org>,
	Richard Weinberger <richard@nod.at>,
	LKML <linux-kernel@vger.kernel.org>,
	Marek Vasut <marek.vasut@gmail.com>,
	Linux mtd <linux-mtd@lists.infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH] mtd: lpddr_cmds: Mark expected switch fall-through
Date: Wed, 10 Apr 2019 14:47:05 -0700	[thread overview]
Message-ID: <CAGXu5j+_CGq=69qAaZz1zYpHx-khRT+VSLtARkU+8txBkdzk2A@mail.gmail.com> (raw)
In-Reply-To: <20190208181210.GA8388@embeddedor>

On Fri, Feb 8, 2019 at 10:12 AM Gustavo A. R. Silva
<gustavo@embeddedor.com> wrote:
>
> In preparation to enabling -Wimplicit-fallthrough, mark switch
> cases where we are expecting to fall through.
>
> This patch fixes the following warnings:
>
> drivers/mtd/lpddr/lpddr_cmds.c: In function ‘chip_ready’:
> drivers/mtd/lpddr/lpddr_cmds.c:319:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
>    if (mode == FL_READY && chip->oldstate == FL_READY)
>       ^
> drivers/mtd/lpddr/lpddr_cmds.c:322: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>

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

-Kees

> ---
>  drivers/mtd/lpddr/lpddr_cmds.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mtd/lpddr/lpddr_cmds.c b/drivers/mtd/lpddr/lpddr_cmds.c
> index b13557fe52bd..76a4c73e100e 100644
> --- a/drivers/mtd/lpddr/lpddr_cmds.c
> +++ b/drivers/mtd/lpddr/lpddr_cmds.c
> @@ -318,6 +318,7 @@ static int chip_ready(struct map_info *map, struct flchip *chip, int mode)
>                 /* Only if there's no operation suspended... */
>                 if (mode == FL_READY && chip->oldstate == FL_READY)
>                         return 0;
> +               /* fall through */
>
>         default:
>  sleep:
> --
> 2.20.1
>


-- 
Kees Cook

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

  parent reply	other threads:[~2019-04-10 21:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-08 18:12 [PATCH] mtd: lpddr_cmds: Mark expected switch fall-through Gustavo A. R. Silva
2019-02-08 18:12 ` Gustavo A. R. Silva
2019-03-20 20:17 ` Gustavo A. R. Silva
2019-03-20 20:17   ` Gustavo A. R. Silva
2019-04-10 21:15   ` Gustavo A. R. Silva
2019-04-10 21:15     ` Gustavo A. R. Silva
2019-04-10 21:47 ` Kees Cook [this message]
2019-04-10 21:47   ` Kees Cook
2019-02-12 15:31 Gustavo A. R. Silva
2019-02-12 15:31 ` Gustavo A. R. Silva
2019-02-13 14:05 ` Boris Brezillon
2019-02-13 14:05   ` Boris Brezillon
2019-02-13 18:11   ` Gustavo A. R. Silva
2019-02-13 18:11     ` Gustavo A. R. Silva

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='CAGXu5j+_CGq=69qAaZz1zYpHx-khRT+VSLtARkU+8txBkdzk2A@mail.gmail.com' \
    --to=keescook@chromium.org \
    --cc=bbrezillon@kernel.org \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=gustavo@embeddedor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=richard@nod.at \
    /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.