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 177FAEB64DA for ; Fri, 14 Jul 2023 07:37:34 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B960086D45; Fri, 14 Jul 2023 09:37:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=radxa.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id E11C686D49; Fri, 14 Jul 2023 09:37:30 +0200 (CEST) Received: from mail.naobsd.org (sakura.naobsd.org [160.16.200.221]) (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 0DACE86BE1 for ; Fri, 14 Jul 2023 09:37:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=radxa.com Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=naoki@radxa.com Received: from secure.fukaumi.org ([10.0.0.2]) by mail.naobsd.org (8.14.4/8.14.4/Debian-4.1ubuntu1.1) with ESMTP id 36E7b0xa013287; Fri, 14 Jul 2023 16:37:01 +0900 From: FUKAUMI Naoki To: u-boot@lists.denx.de Cc: sjg@chromium.org, manuel.traut@mt.com, merker@debian.org, naoki@radxa.com Subject: [PATCH] menu: Ignore prompt variable if timeout is != 0 Date: Fri, 14 Jul 2023 16:36:50 +0900 Message-Id: <20230714073650.83876-1-naoki@radxa.com> X-Mailer: git-send-email 2.39.2 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.8 at phobos.denx.de X-Virus-Status: Clean From: Manuel Traut Since 739e8361f3fe78038251216df6096a32bc2d5839, a system with the following /boot/extlinux/extlinux.conf (which sets timeout to 50) immediately boots the first entry in the config without displaying a boot menu. According to the description, that should only happen if both prompt and timeout are set to zero in the config, but it also happens with timeout set to a non-zero value. Reported-by: Karsten Merker Signed-off-by: Manuel Traut --- common/menu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/menu.c b/common/menu.c index 8fe00965c0..8eabcccc87 100644 --- a/common/menu.c +++ b/common/menu.c @@ -277,6 +277,9 @@ int menu_get_choice(struct menu *m, void **choice) if (!m->item_cnt) return -ENOENT; + if (m->timeout) + return menu_interactive_choice(m, choice); + if (!m->prompt) return menu_default_choice(m, choice); -- 2.39.0