lkml.org 
[lkml]   [2019]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mtd: onenand_base: Avoid fall-through warnings
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

\
 
 \ /
  Last update: 2019-05-22 23:45    [W:0.058 / U:0.892 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site