[{"id":1769861,"web_url":"http://patchwork.ozlabs.org/comment/1769861/","msgid":"<de96173b-3b9b-55aa-2738-89510f126139@gmx.de>","list_archive_url":null,"date":"2017-09-18T04:19:53","subject":"Re: [U-Boot] [PATCH 02/16] efi: Move the init check inside\n\tefi_init_obj_list()","submitter":{"id":61270,"url":"http://patchwork.ozlabs.org/api/people/61270/","name":"Heinrich Schuchardt","email":"xypron.glpk@gmx.de"},"content":"On 09/18/2017 12:59 AM, Simon Glass wrote:\n> Rather than having the caller check this variable and the callee set it,\n> move all access to the variable inside the function. This reduces the\n> logic needed to call efi_init_obj_list().\n> \n> Signed-off-by: Simon Glass <sjg@chromium.org>\n> ---\n> \n>  cmd/bootefi.c | 8 ++++----\n>  1 file changed, 4 insertions(+), 4 deletions(-)\n> \n> diff --git a/cmd/bootefi.c b/cmd/bootefi.c\n> index abfab8fa98..2c9d31c5eb 100644\n> --- a/cmd/bootefi.c\n> +++ b/cmd/bootefi.c\n> @@ -109,6 +109,8 @@ static struct efi_object bootefi_device_obj = {\n>  /* Initialize and populate EFI object list */\n>  static void efi_init_obj_list(void)\n>  {\n> +\tif (efi_obj_list_initalized)\n> +\t\treturn;\n>  \tefi_obj_list_initalized = 1;\n>  \n>  \tlist_add_tail(&loaded_image_info_obj.link, &efi_obj_list);\n> @@ -256,8 +258,7 @@ static unsigned long do_bootefi_exec(void *efi, void *fdt)\n>  \t\treturn -ENOENT;\n>  \n>  \t/* Initialize and populate EFI object list */\n> -\tif (!efi_obj_list_initalized)\n> -\t\tefi_init_obj_list();\n> +\tefi_init_obj_list();\n>  \n>  \t/* Call our payload! */\n>  \tdebug(\"%s:%d Jumping to 0x%lx\\n\", __func__, __LINE__, (long)entry);\n> @@ -311,8 +312,7 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])\n>  \t\t */\n>  \t\tefi_save_gd();\n>  \t\t/* Initialize and populate EFI object list */\n> -\t\tif (!efi_obj_list_initalized)\n> -\t\t\tefi_init_obj_list();\n> +\t\tefi_init_obj_list();\n>  \t\tloaded_image_info.device_handle = bootefi_device_path;\n>  \t\tloaded_image_info.file_path = bootefi_image_path;\n>  \t\treturn efi_selftest(&loaded_image_info, &systab);\n> \n\nReviewed: Heinrich Schuchardt <xypron.glpk@gmx.de>","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xwXpy6Yhvz9s7G\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 18 Sep 2017 14:20:10 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid AA6CBC21EFB; Mon, 18 Sep 2017 04:20:05 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 44530C21D57;\n\tMon, 18 Sep 2017 04:20:03 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid EA516C21D57; Mon, 18 Sep 2017 04:20:01 +0000 (UTC)","from mout.gmx.net (mout.gmx.net [212.227.17.20])\n\tby lists.denx.de (Postfix) with ESMTPS id 87CC3C21D19\n\tfor <u-boot@lists.denx.de>; Mon, 18 Sep 2017 04:20:01 +0000 (UTC)","from [192.168.123.58] ([84.118.154.110]) by mail.gmx.com (mrgmx101\n\t[212.227.17.168]) with ESMTPSA (Nemesis) id\n\t0M2ojS-1dacn43LIk-00sb7K; Mon, 18 Sep 2017 06:19:56 +0200"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.7 required=5.0 tests=FREEMAIL_FROM,\n\tRCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,\n\tRCVD_IN_MSPIKE_WL autolearn=unavailable\n\tautolearn_force=no version=3.4.0","To":"Simon Glass <sjg@chromium.org>,\n\tU-Boot Mailing List <u-boot@lists.denx.de>","References":"<20170917225927.117917-1-sjg@chromium.org>\n\t<20170917225927.117917-3-sjg@chromium.org>","From":"Heinrich Schuchardt <xypron.glpk@gmx.de>","Message-ID":"<de96173b-3b9b-55aa-2738-89510f126139@gmx.de>","Date":"Mon, 18 Sep 2017 06:19:53 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170917225927.117917-3-sjg@chromium.org>","Content-Language":"en-US","X-Provags-ID":"V03:K0:UFHiSMaXYyAZNAeCq7LijElaMgggi47qsQ+AkR4qAXax7Gxrme4\n\t2oUdx0q/xU92HruZ3h4ErfTUSXkyybpnEGukY8JDXld7xpiZyjCBJ14r+pTxPDUDDEYtJst\n\tlMpvIkymw/8FeSTVwRTMA0nKswAzmyBBWUkad5hZnUdoAuhsieI33MK1yqeA1tELuKs0Sla\n\tzprARQhijqv4jva/B61zA==","X-UI-Out-Filterresults":"notjunk:1; V01:K0:8+nrhoFMfTU=:WiaeLfvmNR798L4PWwwz2K\n\t0L0ewd63f73fzQFVHxtX2wLlRHTXH6scXhKXLi6pxAdPMIwg0hGAjG18gxzLS09tgVkQFt60F\n\tvS3gtLnMjt/JUHZSYNP6levgwIkE2/Bko0y2RFdnz5ZV4VunItji22qWtip0s8CmoOk4I5cRY\n\tOD2+MFl9wJBNDXhIFHmOt1DPlwJNP8zDYb6J4Mtw613QcairpHpUKTFdTWBzjerRwA/bC4ilr\n\tusSvv7H3Way3CpY/WtpMZjGcSIHBO92+Kg4qF8W7K7qUJxtl1kv44zNuyyxZzhCGVh2zqCqw3\n\t91+407w/HiE3zJJ9l9Sk7B/Q+ZlwbALarFhAQ9l65DE21Cy85WV9KyXz/CiltU4qoBlejuNuq\n\tGavpxoDRpQ5QfWdhvFrZRhc3zAqZFBovwum+fSZz43eorwWnnTIeTQdRlrOZpNh3snnSpF8LY\n\t0bajGQzJ0TyfeMxkEa4YqeDSDZhR+FFL7uYqeMqI5jh5SEH3H/Xi2xCXCYaN34P1abHUZfRgI\n\tVXXIPlm/o4d8vg4IkaVQO+F0AM821awPbL/sQuGI3eo6SFilmesAyWLEDEC67tnNoXZiLtOGs\n\tXAMMaVscijT/AnTawxHu9OhL4jNfi3WfZTtNvUA6lNozWoXJHGGtcAgdzH+VUofeKaCltXZbo\n\tW4g0WJeAHTvjBR8mvv+KuaFCN9gVH93EAPIL9HCfjlPhhdUB3RPQdh8uiHRJEKzbb5WjrzaOY\n\tYe8hDKAvwfpicDcpd7w9KCJyWVzbCSO0kX3zN534gDkpIWosUO11GZBjcvgqJBQqsu3hvTjvs\n\tanFk1rBLT635R5Q+gHNHyo3zmQjhNwfNnFYPjp+Wpt2bLX4MZk=","Cc":"Heinrich Schuchardt <xypron.glpk@gmx.de>,\n\tAndy Shevchenko <andriy.shevchenko@linux.intel.com>","Subject":"Re: [U-Boot] [PATCH 02/16] efi: Move the init check inside\n\tefi_init_obj_list()","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}}]