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 065BDECAAA1 for ; Tue, 30 Aug 2022 11:54:33 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 61F5B84998; Tue, 30 Aug 2022 13:53:51 +0200 (CEST) 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="sfbK0LDY"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9A80084335; Tue, 30 Aug 2022 13:53:28 +0200 (CEST) Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) (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 AD09A849A2 for ; Tue, 30 Aug 2022 13:53:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-ed1-x530.google.com with SMTP id m1so13853212edb.7 for ; Tue, 30 Aug 2022 04:53:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc; bh=yuCTq7k5AnqlW5MIj4d2fSreAVNLsUZ9zVLs36NRFeM=; b=sfbK0LDYluw+txH944z1y0XXQALwtDngHlxKSjWsIFONpnkFMSsNIysrX2wezZMJul pvKqsCupwWc5pxlb1uRDlh2kYofh6t7XMp0Rj/v9/twBQmi5hXEUdBKJlL8Q0ouk+ncZ w7Hx64u8+hfn8aEkhif4GpzVm1RRK293jjrhDwjfl6e8YzM1btjjadxjqIjv8390gWCC xEUP7uyEiaE8QW1glJl9AX3akdfa9xJcLb0bQuywkz73E9vtHkClxNQXrJ/T5uE3VbVc WPq+PqEDi9FtQdfKvGkGpoIprFauxvAmV1PsLR2a5iZG5Ag0ueE1P0dcicVGqZJR+xOE 1JJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=yuCTq7k5AnqlW5MIj4d2fSreAVNLsUZ9zVLs36NRFeM=; b=EikyTK48Oks0S4CfnaNHX/ney7ERISWFduHdkMEJbLiGHXMZgTQVqHjjQLpY1bdKyJ HBgS++eOWJos/B+ZquW+Ymdi2P/IIdVoTXNquW1ndhMTnN24WM0CAIMrZ05oK8hob56h xxaryW+SiqLloPmh5FK+tRHz5SCs3RH1LOktMRBlaZsRUmbACOS5ZIaSa+OOW6Da6qLf L0YPmRZoYAIcnv7k6dBjIKR+P8R73EOv1NJ2iGfsoxbYpGnDv5BP8mCa06Pb569r39S2 /r15lmO67lJCcznbnbiV+IPascoN6HMtD/IYCzJuKHpUr4v0bYrIn8p3VDcfjw4GnZ29 eLDg== X-Gm-Message-State: ACgBeo1BjqC9lcrhKcFznsiDAfOC4Cv0+Lwg3YJwuF3s8WyHDbjkYa/X n+ZJCQWZIIY9xOvLerleTUzt4Q== X-Google-Smtp-Source: AA6agR7U/LgOvDv2GceBTh9qxcrEdeaO0vcRoJahqbBWUbFUs1q4DQqXzzSZKZbkI5S2pi1Xdn4yqw== X-Received: by 2002:a05:6402:1c84:b0:447:9d79:74fe with SMTP id cy4-20020a0564021c8400b004479d7974femr20364816edb.378.1661860404210; Tue, 30 Aug 2022 04:53:24 -0700 (PDT) Received: from hades ([46.103.15.185]) by smtp.gmail.com with ESMTPSA id r10-20020a170906c28a00b0073d60922edfsm5655621ejz.102.2022.08.30.04.53.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Aug 2022 04:53:22 -0700 (PDT) Date: Tue, 30 Aug 2022 14:53:19 +0300 From: Ilias Apalodimas To: Masahisa Kojima Cc: u-boot@lists.denx.de, Heinrich Schuchardt , Simon Glass , Takahiro Akashi , Mark Kettenis , Michal Simek , Ovidiu Panait , Ashok Reddy Soma , John Keeping , Chris Morgan , Kever Yang , Huang Jianan Subject: Re: [PATCH v14 01/10] eficonfig: menu-driven addition of UEFI boot option Message-ID: References: <20220826064223.23288-1-masahisa.kojima@linaro.org> <20220826064223.23288-2-masahisa.kojima@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220826064223.23288-2-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.6 at phobos.denx.de X-Virus-Status: Clean Hi Kojima-san, [...] > +/** > + * eficonfig_choice_entry() - user key input handler > + * > + * @data: pointer to the efimenu structure > + * Return: key string to identify the selected entry > + */ > +static char *eficonfig_choice_entry(void *data) > +{ > + int esc = 0; > + struct list_head *pos, *n; > + struct eficonfig_entry *entry; > + enum bootmenu_key key = KEY_NONE; > + struct efimenu *efi_menu = data; > + > + while (1) { > + bootmenu_loop((struct bootmenu_data *)efi_menu, &key, &esc); > + > + switch (key) { > + case KEY_UP: > + if (efi_menu->active > 0) > + --efi_menu->active; > + /* no menu key selected, regenerate menu */ > + return NULL; > + case KEY_DOWN: > + if (efi_menu->active < efi_menu->count - 1) > + ++efi_menu->active; > + /* no menu key selected, regenerate menu */ > + return NULL; > + case KEY_SELECT: > + list_for_each_safe(pos, n, &efi_menu->list) { > + entry = list_entry(pos, struct eficonfig_entry, list); > + if (entry->num == efi_menu->active) > + return entry->key; > + } > + break; > + case KEY_QUIT: > + /* Quit by choosing the last entry */ > + entry = list_last_entry(&efi_menu->list, struct eficonfig_entry, list); > + return entry->key; > + default: > + /* Pressed key is not valid, no need to regenerate the menu */ Even with this comment I am still not sure I am following. The function definition is a char *. There are cases ('default' and 'KEY_SELECT') which have no return value at all. Shouldn't there be a 'return NULL' in the end of the function, even if that's not supposed to happen? [...] Thanks /Ilias