From: Kees Cook <keescook@chromium.org>
To: Boris Brezillon <boris.brezillon@collabora.com>
Cc: Vignesh Raghavendra <vigneshr@ti.com>,
"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
Richard Weinberger <richard@nod.at>,
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: Avoid fall-through warnings
Date: Wed, 22 May 2019 14:45:15 -0700 [thread overview]
Message-ID: <201905221444.014568B0F4@keescook> (raw)
In-Reply-To: <20190522233705.234d75d5@collabora.com>
On Wed, May 22, 2019 at 11:37:05PM +0200, Boris Brezillon wrote:
> > @@ -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 - ? */
>
> So, the only thing that you'll re-use by falling through the next case
> is the '->options |= ONENAND_HAS_UNLOCK_ALL' operation. I find it easier
> to follow with an explicit copy of this line + a break.
>
> >
> > 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 - ? */
>
> This fall through certainly doesn't make sense, as the only thing that
> might be done in the 1Gb case is conditionally adding the
> HAS_UNLOCK_ALL flag, and this flag is already unconditionally set.
> Please add a break here.
>
> >
> > case ONENAND_DEVICE_DENSITY_1Gb:
> > /* A-Die has all block unlock */
>
Your reply was much more to-the-point than mine. :) I'd agree: retain
existing behavior (ONENAND_HAS_UNLOCK_ALL) and add breaks.
--
Kees Cook
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
prev parent reply other threads:[~2019-05-22 21:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-22 18:04 [PATCH] mtd: onenand_base: Avoid fall-through warnings Gustavo A. R. Silva
2019-05-22 21:30 ` Kees Cook
2019-05-22 21:57 ` Boris Brezillon
2019-05-22 22:20 ` Kees Cook
2019-05-22 22:30 ` Gustavo A. R. Silva
2019-05-22 21:37 ` Boris Brezillon
2019-05-22 21:45 ` Kees Cook [this message]
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=201905221444.014568B0F4@keescook \
--to=keescook@chromium.org \
--cc=boris.brezillon@collabora.com \
--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 \
/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 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).