From patchwork Thu Mar 24 13:54:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 553912 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:1248:0:0:0:0 with SMTP id z8csp4437888mag; Thu, 24 Mar 2022 06:54:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxaYLVRkxkEPNU2VkXn93oieh1Kk6MxB4le5lCEBuh7MSiShEdmD4GcbgadIeE7XWcVAO7G X-Received: by 2002:a05:6402:b7a:b0:419:3046:3abb with SMTP id cb26-20020a0564020b7a00b0041930463abbmr6823030edb.257.1648130099632; Thu, 24 Mar 2022 06:54:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648130099; cv=none; d=google.com; s=arc-20160816; b=VLYz+wZX66JILDIhjXufJnT2sTRAnXjwhumdbfvBTZAp1GVJ2yJJj0HwJATuCMbnna ldqr3OnMif1PY+wq6wFRaukdBUnxNItGKH/vMSUDQpMjde/NZkRCgMhZnLSyV7zDbm65 s8ejpKDZNDzK6y2Yg9opNUQvN/Q29v3n8KKypNjqvNF1YqSdMzqNt4oZ6akIizlmWSO6 Yc5UtMM1ZzON91QQqaGjDbu7UVOeuS0zJGHeVjKWYYy5kr+usd2wesrt81Nojb9Sf9LE BLzQE7khDbj5axG0oRwXvZB1x3up9CX5w0y5LtyTHPm7+DojBaiODn9ac9/WHCNK+C7l gLSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=QBSkDh3vm6Z4sZAfYprPul9XVTdLS/kAXFY6He4ogYE=; b=CvWiHXzOFpLKU7xej7ZN/Hk1rjMETztm2gNQW2ZPDvX4UAB/nczRQTYbmfwlGhO4Rx fW8pLrFnsi1pjxdxiexIjMT6pIYhS1fvYb2/0/z+I2FCqBNcLPR+lpOGptu3mCVHuXO8 C91lkIGKUBrteGSJ1aqspO0mB5PGT6PSzv3m5t4IkxYKgCknjpEv96Ghc/BW2tkrkx2j IMLYN1+SH0Rg/lZ8urFCFqgIpRuFoSr6ru+IWW0LoLtBOJcworKElzQOPBlImQBE8v3m s4R07X9dYDjL7NCqWPx4OFUN1xojiigtRycT51GrHROGXj9gHxdXUOaDy5pT6D51QDPm IPlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c7sXBQRB; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id tc26-20020a1709078d1a00b006df76385d3fsi12561493ejc.479.2022.03.24.06.54.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Mar 2022 06:54:59 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c7sXBQRB; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2DBCE840B3; Thu, 24 Mar 2022 14:54:50 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.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=linaro.org header.i=@linaro.org header.b="c7sXBQRB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ECB8C840AC; Thu, 24 Mar 2022 14:54:44 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) (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 27AA1840A6 for ; Thu, 24 Mar 2022 14:54:42 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masahisa.kojima@linaro.org Received: by mail-pl1-x62a.google.com with SMTP id k6so4734512plg.12 for ; Thu, 24 Mar 2022 06:54:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QBSkDh3vm6Z4sZAfYprPul9XVTdLS/kAXFY6He4ogYE=; b=c7sXBQRBb5Mm2ZM9oWlbubqOlSqrkLnHupOqk5zzuOqDUZZfqHXojyaLWhYN2YuCL2 /cIxgkq/oy8amoTnuJu2BAIhPfoQGgjIyXRv8iUi5K3w48OG6g8EDvsAbWpgaHdNASpJ WDvOVsO6mhBh4b0FcnoxrbkTB0KjwKnSMoyz6iKbyspmAAOStkMa5t1OOs5Wzyth/wnZ K0Tb3rJ4RojpqOk+brXwE8RkeYVLP2xyMZWd3deR4YsAMaOvE2GhKUzh0hfjNide5FVY iw1LQuHjUVYmcalPGYb4LjjNrlSf65DV/FhfcrPeyTRdyyU7Y836Vmny8IJbNycOL5Ig NaiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QBSkDh3vm6Z4sZAfYprPul9XVTdLS/kAXFY6He4ogYE=; b=Uir0ZpMqvRpnN7YVoadLfPuPsdeJ0yTnOLoZXfunnk7YqtAOeBbxmJISY5obHjFLw9 x00yIwmlE6us27Bltkb5bGMMkzL6M4L8cIDKgMq6tVEk9aLmDYWsxfo8G2JN7buppUik N7VWo5OY5Z7J/jVrwuibL/CENiLJgdB0ehh9HNZDu+vWavAgIqJgXjw0Mev+fAPC8TYM 8tHHbNeu8f3GR3Au5QiX2ywePZr32fHCWt+oPjHLVJgiyT5iDCOGC1vzElTh7IArI8Cf oZ3U9n0+P2Oi7UyMmP6jGTOTIWwT7gqO9Z06YuNbAj2nygzp6OMYRdUMsXdRysg4av4b Temg== X-Gm-Message-State: AOAM530zKxalB0Xu59nZN1mbYrXPF6jEcAjJVzk+7YaT2OkEruO1A4M5 YXj3p7RD0KgLOnw4Cb6YRAeZ+0q7JLaCOw== X-Received: by 2002:a17:902:ecd1:b0:154:5393:aaa4 with SMTP id a17-20020a170902ecd100b001545393aaa4mr5859283plh.131.1648130080489; Thu, 24 Mar 2022 06:54:40 -0700 (PDT) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id p15-20020a056a000a0f00b004f7c63cba5asm3974609pfh.21.2022.03.24.06.54.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Mar 2022 06:54:40 -0700 (PDT) From: Masahisa Kojima To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Simon Glass , Takahiro Akashi , Francois Ozog , Mark Kettenis , Masahisa Kojima Subject: [PATCH v4 01/11] bootmenu: fix menu API error handling Date: Thu, 24 Mar 2022 22:54:33 +0900 Message-Id: <20220324135443.1571-2-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220324135443.1571-1-masahisa.kojima@linaro.org> References: <20220324135443.1571-1-masahisa.kojima@linaro.org> 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.5 at phobos.denx.de X-Virus-Status: Clean U-Boot menu framework(common/menu.c) returns 1 if it is successful, returns negative value if it fails. Signed-off-by: Masahisa Kojima Acked-by: Ilias Apalodimas --- Newly added in v4 cmd/bootmenu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/bootmenu.c b/cmd/bootmenu.c index 409ef9a848..d573487272 100644 --- a/cmd/bootmenu.c +++ b/cmd/bootmenu.c @@ -463,7 +463,7 @@ static void bootmenu_show(int delay) } for (iter = bootmenu->first; iter; iter = iter->next) { - if (!menu_item_add(menu, iter->key, iter)) + if (menu_item_add(menu, iter->key, iter) != 1) goto cleanup; } @@ -476,7 +476,7 @@ static void bootmenu_show(int delay) init = 1; - if (menu_get_choice(menu, &choice)) { + if (menu_get_choice(menu, &choice) == 1) { iter = choice; title = strdup(iter->title); command = strdup(iter->command);