From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Petazzoni Date: Mon, 8 Oct 2018 21:07:59 +0200 Subject: [U-Boot] [PATCH v13 5/7] cmd: mtd: add 'mtd' command In-Reply-To: <20181008194627.71352d73@bbrezillon> References: <20181001134331.9756-1-miquel.raynal@bootlin.com> <20181001134331.9756-6-miquel.raynal@bootlin.com> <20181008194627.71352d73@bbrezillon> Message-ID: <20181008210759.250b0e8a@windsurf> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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, Thomas -- Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com