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 575CFECAAD4 for ; Tue, 30 Aug 2022 12:57:28 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 79B01848E6; Tue, 30 Aug 2022 14:57:25 +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="Cz8j/aD7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C94018497F; Tue, 30 Aug 2022 14:57:23 +0200 (CEST) Received: from mail-yw1-x1135.google.com (mail-yw1-x1135.google.com [IPv6:2607:f8b0:4864:20::1135]) (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 C60A184876 for ; Tue, 30 Aug 2022 14:57:20 +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-yw1-x1135.google.com with SMTP id 00721157ae682-333a4a5d495so270170477b3.10 for ; Tue, 30 Aug 2022 05:57:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=yzVcODpQVE0P/h0hE9tQip7hohj5NmAV2Z9rFdIA5l0=; b=Cz8j/aD7TF2KRB4R5Y/VK4qU7Z6jvaJJzsfUgmxOZhcUOkG2/0mUmDNDBXmJJwOlPX 64gekuHaCJUycn5M/C6f6i8rYkVJ7dR0Bdz1pVu5QljJwFYmLoFCAjQttrRPybHVKtbg nGZRnuvtjcIXZCGpHeLaGDxWXOelfjRjjNFlN1yMSl8aG8ZPgdWB7n+rzPLwdfR+s0oH NMDk7kjDS404y/lPiC+z/UbwZlteGB9Zpiju6JciKkZAEs7vJzhKFgpwrFzfb4Ut9wNr sQR67b58NldQjNIqnwvHbOswefWOwDRqg/C+q3+rbzDFElbM4Cz2nFam9/ig7UP4Eehf 1GLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=yzVcODpQVE0P/h0hE9tQip7hohj5NmAV2Z9rFdIA5l0=; b=z9vfu+XIegWtebTdiS8Vr3OOn4eEq+RHuJA+8mbnDCHNCi5hunpeN7OZwy1w+cKGdk kJodKnWGjoLnXkjPvaN48UCwQ+7BC6elEzEnTADk8y49VmCkCE78fubia96fnpH66p+Q /k2ee2cRb8pR1YXTcUrE6WHIuqGRpgQ7kjHMOhSzR+OjzDKAXqzjcVIqKSQcynb5LqZ7 5BYeLDw88vcYbEatn8EQH2+GeWhz36FPIuo6MsskGq/TZiMACkEIpWPUlfuN4LQ+4EcB rgTOx+rCrajD294P6scPwNPDe5GVlvIS+E2DyS4LVSPa7faeFvAmo2LBFIKMrOleBJa3 tH9Q== X-Gm-Message-State: ACgBeo2MQJ8DPL1e64Jbf38HIZwm4gn5n12/0wUCpfg9OOblAh6yYr5k SKQwenlV7z4VATTevMRqVS+vzEDiPhpiVbGZSpkZ5Q== X-Google-Smtp-Source: AA6agR4MWmNsGRxRIY4YRCJ8VjHXCy6zGxwq/RACUEDUv9+yNBilKyvZGxL1CkT2BJTSFNs92X7QmSaSab3TTSOg7ec= X-Received: by 2002:a81:4ccf:0:b0:32f:cccf:cef7 with SMTP id z198-20020a814ccf000000b0032fcccfcef7mr13945646ywa.191.1661864239438; Tue, 30 Aug 2022 05:57:19 -0700 (PDT) MIME-Version: 1.0 References: <20220826064223.23288-1-masahisa.kojima@linaro.org> <20220826064223.23288-2-masahisa.kojima@linaro.org> In-Reply-To: From: Ilias Apalodimas Date: Tue, 30 Aug 2022 15:56:43 +0300 Message-ID: Subject: Re: [PATCH v14 01/10] eficonfig: menu-driven addition of UEFI boot option 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 Content-Type: text/plain; charset="UTF-8" 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 On Tue, 30 Aug 2022 at 14:53, Ilias Apalodimas wrote: > > 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? nvm, I missed the while(1) loop at the beginning. This is fine Cheers /Ilias > > [...] > > Thanks > /Ilias >