Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 495F3C4332F for ; Mon, 21 Nov 2022 17:37:12 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 75203853B7; Mon, 21 Nov 2022 18:37:10 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="AIuky+tK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 34DAA853A8; Mon, 21 Nov 2022 18:37:09 +0100 (CET) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2626185398 for ; Mon, 21 Nov 2022 18:37:07 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AC800B810E7; Mon, 21 Nov 2022 17:37:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33A21C433C1; Mon, 21 Nov 2022 17:37:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669052225; bh=VDkoTyVZxH7aYTsZLhVc6Zgc3YovZTuv/U6TPZLa24E=; h=Date:From:To:Subject:References:In-Reply-To:From; b=AIuky+tKArckeepH23i9Ys/j6KZ8hOLG9IhP/NGV1RsJQ+vXpb7vwq35RSh+BKX6w 2ViBStzSi1CyYMKbr7IGWQNJjMBLUkWZIZOLYyZUFZnezg+9aRegdSG19xq3ypbdjO L59njC/D6EPGVOKlkcjsEoZLPSlxrvo2Sr9AmoA4sE3h79C/2Toxi73g3zdvN+sahp BFYGsQMvwbD5K9qYndUy8cp/CxztlSAsAXmPdKVGycGYXQlpMRkDzPE9mBVJzc3o2j jqHaUCU73NjSDm7Cl3Esg26zdY8tLG7FWGWJhjjsbyWCYbU1hesJ527kQ51tzeJDE8 1ZcMsNlB8iitQ== Received: by pali.im (Postfix) id 7FF697CC; Mon, 21 Nov 2022 18:37:02 +0100 (CET) Date: Mon, 21 Nov 2022 18:37:02 +0100 From: Pali =?utf-8?B?Um9ow6Fy?= To: Tom Rini , u-boot@lists.denx.de Subject: Re: [PATCH] cmd: ubifs: Do not show usage when command fails Message-ID: <20221121173702.qynzsflpu33aj55v@pali> References: <20220807195856.19782-1-pali@kernel.org> <20221009111847.c5yyxsw2b57nl5nh@pali> <20221101222015.nxp22oez7gpgkyk5@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221101222015.nxp22oez7gpgkyk5@pali> User-Agent: NeoMutt/20180716 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean + Tom On Tuesday 01 November 2022 23:20:15 Pali Rohár wrote: > ping? > > On Sunday 09 October 2022 13:18:47 Pali Rohár wrote: > > PING? > > > > On Sunday 07 August 2022 21:58:56 Pali Rohár wrote: > > > Return value -1 cause U-Boot to print usage message. Return value > > > 1 (CMD_RET_FAILURE) indicates failure. So fix return value when ubifs > > > command starts it execution and fails. > > > > > > Signed-off-by: Pali Rohár > > > --- > > > cmd/ubifs.c | 8 ++++---- > > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > > > diff --git a/cmd/ubifs.c b/cmd/ubifs.c > > > index 7a620c5e21da..6a01d0988a2d 100644 > > > --- a/cmd/ubifs.c > > > +++ b/cmd/ubifs.c > > > @@ -33,7 +33,7 @@ int cmd_ubifs_mount(char *vol_name) > > > > > > ret = uboot_ubifs_mount(vol_name); > > > if (ret) > > > - return -1; > > > + return CMD_RET_FAILURE; > > > > > > ubifs_mounted = 1; > > > > > > @@ -62,7 +62,7 @@ int cmd_ubifs_umount(void) > > > { > > > if (ubifs_initialized == 0) { > > > printf("No UBIFS volume mounted!\n"); > > > - return -1; > > > + return CMD_RET_FAILURE; > > > } > > > > > > uboot_ubifs_umount(); > > > @@ -89,7 +89,7 @@ static int do_ubifs_ls(struct cmd_tbl *cmdtp, int flag, int argc, > > > > > > if (!ubifs_mounted) { > > > printf("UBIFS not mounted, use ubifsmount to mount volume first!\n"); > > > - return -1; > > > + return CMD_RET_FAILURE; > > > } > > > > > > if (argc == 2) > > > @@ -116,7 +116,7 @@ static int do_ubifs_load(struct cmd_tbl *cmdtp, int flag, int argc, > > > > > > if (!ubifs_mounted) { > > > printf("UBIFS not mounted, use ubifs mount to mount volume first!\n"); > > > - return -1; > > > + return CMD_RET_FAILURE; > > > } > > > > > > if (argc < 3) > > > -- > > > 2.20.1 > > >