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 22339C433F5 for ; Tue, 11 Oct 2022 15:48:15 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B15B384F1B; Tue, 11 Oct 2022 17:48:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="ONLxouz9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3BDDD84F16; Tue, 11 Oct 2022 17:48:10 +0200 (CEST) Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 50159840AE for ; Tue, 11 Oct 2022 17:48:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12c.google.com with SMTP id a2so7345387iln.13 for ; Tue, 11 Oct 2022 08:48:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Jo3RRbbQvE09JxJtmZBCPvErobFfiQdhbScPAwCAblE=; b=ONLxouz9easxnPnViURM5ptbOQBJKL4N56Kbqt3aVA2ws6TQopPSi67SBSSh3jFXJA v1mQUNe4biJD1Dm8Xtk09A/LeQEWI7ZveOK67AgKNKjCF8dGKpdbwuEKyN+FD5eaaC5u ijLuqi+JHepAz0wMUSFQsTXJSIfsXf9jQBIkw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Jo3RRbbQvE09JxJtmZBCPvErobFfiQdhbScPAwCAblE=; b=C9+fVqwlqNhDnAkglNS3k459rAe58g7wFgJ4Dg/y4LYtrg/DH7bcdTCCSRysCnydc5 0A0qPinG2pAdRzAjVJmroYIEFg8XUmv6W3xY/WPxRQaCPCZTg0AohcnghOYpJrljyRNU azEoj86BVcnTH0RmuMWfiFEWU8VkD2KQeciDZRoICvryOumaeQ8A8D3e2FXPawNCBCci U7zvBcM6FpL4INQk1Yfxs2ZJw4iG2iPYuBem/jzNC5tKjGstNrfKsCvtcFW2oDFFOyrI 36HK+mN5AcbmdJPbLjJXq6eRIMgoxBOI0f0FJXQFAxKrfFGS7EzCPkV+GZm0S/WLNuPS T46g== X-Gm-Message-State: ACrzQf2asn99/RLv4GYN0qtJ6vFh2Gm9g7JoJgZconqfF1jj+PKcdpDG 0NFfhfVpqA9r0Lk6MRRpzbnbzC0kGsO09g== X-Google-Smtp-Source: AMsMyM69C2QhtjP5mCmzAxVtQJwnED4zTbHW9FLfDArRZc3Eqgy5DsjQrMo6eGhEIlr1nlemPGIBMA== X-Received: by 2002:a05:6e02:178d:b0:2fa:951e:2c67 with SMTP id y13-20020a056e02178d00b002fa951e2c67mr12270583ilu.46.1665503285521; Tue, 11 Oct 2022 08:48:05 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-67-190-102-125.hsd1.co.comcast.net. [67.190.102.125]) by smtp.gmail.com with ESMTPSA id r12-20020a922a0c000000b002f9b55e7e92sm4988680ile.0.2022.10.11.08.48.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Oct 2022 08:48:05 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Artem Lapkin , Daniel Golle , Heinrich Schuchardt , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Philippe Reynes Subject: [PATCH v2 01/14] bootm: Change incorrect 'unsupported' error Date: Tue, 11 Oct 2022 09:47:07 -0600 Message-Id: <20221011154720.550320-2-sjg@chromium.org> X-Mailer: git-send-email 2.38.0.rc1.362.ged0d419d3c-goog In-Reply-To: <20221011154720.550320-1-sjg@chromium.org> References: <20221011154720.550320-1-sjg@chromium.org> MIME-Version: 1.0 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 At present when bootm fails, it says: subcommand not supported and then prints help for the bootm command. This is not very useful, since generally the error is related to something else, such as fixups failing. It is quite confusing to see this in a test run. Change the error and show the error code. We could update the OS functions to return -ENOSYS when they do not support the bootm subcommand. But this involves some thought since this is arch-specific code and proper errno error codes are not always returned. Also, with the code as is, all required subcommands are of course supported - a problem would only come if someone added a new one or removed support for one from an existing OS. Therefore it seems better to leave that sort of effort for when our bootm tests are improved. Note: v1 of this patch generated a discussion[1] about printing error strings automatically using printf(). That is outside the scope of this patch but will be dealt with separately. [1] https://patchwork.ozlabs.org/project/uboot/patch/20220909151801.336551-3-sjg@chromium.org/ Signed-off-by: Simon Glass --- (no changes since v1) boot/bootm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot/bootm.c b/boot/bootm.c index 5b20b418dba..a4c0870c0fe 100644 --- a/boot/bootm.c +++ b/boot/bootm.c @@ -790,7 +790,7 @@ int do_bootm_states(struct cmd_tbl *cmdtp, int flag, int argc, /* Check for unsupported subcommand. */ if (ret) { - puts("subcommand not supported\n"); + printf("subcommand failed (err=%d)\n", ret); return ret; } -- 2.38.0.rc1.362.ged0d419d3c-goog