From mboxrd@z Thu Jan 1 00:00:00 1970 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 8F58CC19F2A for ; Sun, 7 Aug 2022 19:59:13 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 59E498458A; Sun, 7 Aug 2022 21:59:11 +0200 (CEST) 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="C9xsJhtN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 835A283F88; Sun, 7 Aug 2022 21:59:09 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (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 48D68814BD for ; Sun, 7 Aug 2022 21:59:07 +0200 (CEST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 0072F60C99 for ; Sun, 7 Aug 2022 19:59:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A0E0C433D7 for ; Sun, 7 Aug 2022 19:59:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659902345; bh=cue0Y+VV5huv8A9rINyTGX82/1X45NGmHx73p6AMs1g=; h=From:To:Subject:Date:From; b=C9xsJhtNB/3SIf9qN+Liir6AuZQs8DY+xjhTjo+dV48ycnbjhfeGD2obzEhlacbLr JNqY6KPdUGRaGtlVZS9V32+SnIlt96b/1ommXaeOXX42UvD3U/0wNkYluu7fD9Hb5W r3ckXNwYLpyp90SlM5jSvvXQKqcDtseYKCWAlTjiM+rIInaV7mysx/WXF/mETeuhLa QQSqVyCRP79vwUKuwvhbfhyOb/O+u7meQs/ahglqFao8DTekfCXikWY75x1KftMAAA 1GCuSF7c7N8QZRBIIgo4maPtgUpPtq3aXpd/k/krPSfn1p4d7+yxop5m78lLRYd3PT BgFvYE06yc6Cw== Received: by pali.im (Postfix) id 8F2BB97B; Sun, 7 Aug 2022 21:59:02 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: u-boot@lists.denx.de Subject: [PATCH] cmd: ubifs: Do not show usage when command fails Date: Sun, 7 Aug 2022 21:58:56 +0200 Message-Id: <20220807195856.19782-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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