[U-Boot] [PATCH v13 5/7] cmd: mtd: add 'mtd' command

Adam Ford aford173 at gmail.com
Mon Oct 8 19:14:41 UTC 2018


On Mon, Oct 8, 2018 at 2:10 PM Thomas Petazzoni
<thomas.petazzoni at bootlin.com> wrote:
>
> Hello,
>
> On Mon, 8 Oct 2018 19:46:27 +0200, Boris Brezillon wrote:
>
> > > +   /* Check if mtdparts/mtdids changed since last call, otherwise: exit */
> > > +   if (!strcmp(mtdparts, old_mtdparts) && !strcmp(mtdids, old_mtdids))
> > > +           return 0;
> >
> > Should be:
> >
> >       if ((!mtdparts && !old_mtdparts && !mtdids && !old_mtdids) ||
>
> If there's a || here, it means you can split the conditions into to:
>
>         if (!mtdparts && !old_mtdparts && !mtdids && !old_mtdids)
>                 return 0;
>
>         if (mtdparts && old_mtdparts && mtdids && old_mtdids &&
>             !strcmp(mtdparts, old_mtdparts) &&
>             !strcmp(mtdids, old_mtdids)))
>                 return 0;
>
> Best regards,

Is there a reason, it can't be left the way it was?

adam
>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot


More information about the U-Boot mailing list