lkml.org 
[lkml]   [2019]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] mtd: cfi_util: mark expected switch fall-throughs
----- Ursprüngliche Mail -----
> Von: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
> An: "Miquel Raynal" <miquel.raynal@bootlin.com>
> CC: "David Woodhouse" <dwmw2@infradead.org>, "Brian Norris" <computersforpeace@gmail.com>, "Boris Brezillon"
> <bbrezillon@kernel.org>, "Marek Vasut" <marek.vasut@gmail.com>, "richard" <richard@nod.at>, "linux-mtd"
> <linux-mtd@lists.infradead.org>, "linux-kernel" <linux-kernel@vger.kernel.org>, "Kees Cook" <keescook@chromium.org>
> Gesendet: Dienstag, 7. Mai 2019 16:54:12
> Betreff: Re: [PATCH] mtd: cfi_util: mark expected switch fall-throughs

> Hi all,
>
> Thanks a lot for this, Richard:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git/log/?h=mtd%2Fnext&qt=grep&q=fall-through
>
> There are only two of these warnings left to be addressed in
> MTD[1]:
>
> > @@ -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 */
> >
> > 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 looks strange.
>
> In ONENAND_DEVICE_DENSITY_2Gb:
> ONENAND_HAS_UNLOCK_ALL is set unconditionally.
>
> But then, under ONENAND_DEVICE_DENSITY_1Gb, the same option is set only
> if process is evaluated to true.
>
> Same problem with ONENAND_HAS_2PLANE:
> - it is set in ONENAND_DEVICE_DENSITY_4Gb only if ONENAND_IS_DDP()
> - it is unset in ONENAND_DEVICE_DENSITY_2Gb only if !ONENAND_IS_DDP()
>
> Maybe this portion should be reworked because I am unsure if this is a
> missing fall through or a bug.
>
>
> Thanks
> --
> Gustavo
>
> [1] https://lore.kernel.org/patchwork/patch/1036251/

Did we miss this patch? AFAICT it is in -next too.

Thanks,
//richard

\
 
 \ /
  Last update: 2019-05-07 17:49    [W:0.777 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site