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 2D966C00140 for ; Tue, 26 Jul 2022 14:13:11 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4A7DE84131; Tue, 26 Jul 2022 16:12:36 +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="aO6c0xnA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6ABA684099; Tue, 26 Jul 2022 16:12:24 +0200 (CEST) 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 2ABC784163 for ; Tue, 26 Jul 2022 16:12:17 +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 ams.source.kernel.org (Postfix) with ESMTPS id DA6D9B81678; Tue, 26 Jul 2022 14:12:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 77AECC43470; Tue, 26 Jul 2022 14:12:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658844735; bh=1fWfNv0eJo2fJPW29D6fy338tevrDptR70pBmol4ju4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aO6c0xnA/004cwajDRr+ELGhX1VUDXfgjOWUUaMuLT3k0+8HvhbCzr9A11kKhhwxx LnorAJc1Y7vybIAOSQzkN+Uz+BUxS1A2JF3/d0i27q4/h5oCIr51dBJs8hwbJr1KOK RupVFx99QfkxJB86tPwhjoKMun37pTuVQkAaq2vyviKrKWYbBEcZEBbDNvq4qCPKwP T24NA2WW/kt3tGjaaXVm9VfkYD5LFwcqqHd/Ib4PbSrViVQt046oKN20JbwuB1fpqE sOHTLAZ3er3vHPd2/WBDbO4kWBK14TFzTG1vruwIQ78HEZtogyI1feoMIfxIArnoZj GZxmkw8u2q6XQ== Received: by pali.im (Postfix) id F3AA94A1D; Tue, 26 Jul 2022 16:12:12 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Stefan Roese , Michal Simek , Simon Glass Cc: u-boot@lists.denx.de Subject: [PATCH 4/4] cmd: mvebu/bubt: Fix cmd main return value on error Date: Tue, 26 Jul 2022 16:11:59 +0200 Message-Id: <20220726141159.19774-5-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220726141159.19774-1-pali@kernel.org> References: <20220726141159.19774-1-pali@kernel.org> 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 Negative return value from cmd main function cause U-Boot to print criplic error message: exit not allowed from main input shell. Set return value on error to 1. Signed-off-by: Pali Rohár --- cmd/mvebu/bubt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/mvebu/bubt.c b/cmd/mvebu/bubt.c index 276069a0efc2..ffa05bc20181 100644 --- a/cmd/mvebu/bubt.c +++ b/cmd/mvebu/bubt.c @@ -870,11 +870,11 @@ int do_bubt_cmd(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) dst = find_bubt_dev(dst_dev_name); if (!dst) { printf("Error: Unknown destination \"%s\"\n", dst_dev_name); - return -EINVAL; + return 1; } if (!bubt_is_dev_active(dst)) - return -ENODEV; + return 1; /* Figure out the source device */ src = find_bubt_dev(src_dev_name); @@ -891,15 +891,15 @@ int do_bubt_cmd(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) image_size = bubt_read_file(src); if (!image_size) - return -EIO; + return 1; err = bubt_verify(dst); if (err) - return err; + return 1; err = bubt_write_file(dst, image_size); if (err) - return err; + return 1; return 0; } -- 2.20.1