From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Brezillon Date: Mon, 6 Aug 2018 22:38:56 +0200 Subject: [U-Boot] [PATCH 3/4] cmd: mtd: Don't use with negative return codes for shell commands In-Reply-To: <20180806151253.31205-3-sr@denx.de> References: <20180806151253.31205-1-sr@denx.de> <20180806151253.31205-3-sr@denx.de> Message-ID: <20180806223856.067d9626@bbrezillon> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Mon, 6 Aug 2018 17:12:52 +0200 Stefan Roese wrote: > When negative return codes are used in commands (do_foo()), the shell > prints these messages: > > exit not allowed from main input shell. > > Change the return codes in the new mtd commands to use only positive > values and these annoying warnings are gone. > > Signed-off-by: Stefan Roese > Cc: Miquel Raynal > Cc: Boris Brezillon > Cc: Jagan Teki > --- > cmd/mtd.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/cmd/mtd.c b/cmd/mtd.c > index 221b12500f..38a89736cf 100644 > --- a/cmd/mtd.c > +++ b/cmd/mtd.c > @@ -188,7 +188,7 @@ static int do_mtd_list(void) > > if (!dev_nb) { > printf("No MTD device found\n"); > - return -EINVAL; > + return EINVAL; How about using CMD_RET_FAILURE for all errors?