{"id":814721,"url":"http://patchwork.ozlabs.org/api/patches/814721/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20170917225927.117917-3-sjg@chromium.org/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170917225927.117917-3-sjg@chromium.org>","list_archive_url":null,"date":"2017-09-17T22:59:13","name":"[U-Boot,02/16] efi: Move the init check inside efi_init_obj_list()","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"06a7d349f203c8ef6a36d66f5fe6a19189520d7f","submitter":{"id":6170,"url":"http://patchwork.ozlabs.org/api/people/6170/?format=json","name":"Simon Glass","email":"sjg@chromium.org"},"delegate":{"id":3400,"url":"http://patchwork.ozlabs.org/api/users/3400/?format=json","username":"agraf","first_name":"Alexander","last_name":"Graf","email":"agraf@suse.de"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20170917225927.117917-3-sjg@chromium.org/mbox/","series":[{"id":3549,"url":"http://patchwork.ozlabs.org/api/series/3549/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=3549","date":"2017-09-17T22:59:11","name":"efi: Enable basic sandbox support for EFI loader","version":1,"mbox":"http://patchwork.ozlabs.org/series/3549/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/814721/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/814721/checks/","tags":{},"related":[],"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>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=google.com header.i=@google.com\n\theader.b=\"lelRl1/E\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xwQhh2t9nz9s7c\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 18 Sep 2017 09:44:20 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 30C77C21E9B; Sun, 17 Sep 2017 23:44:18 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 1AC59C21DA9;\n\tSun, 17 Sep 2017 23:00:56 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 7E1DFC21D80; Sun, 17 Sep 2017 23:00:53 +0000 (UTC)","from mail-io0-f176.google.com (mail-io0-f176.google.com\n\t[209.85.223.176])\n\tby lists.denx.de (Postfix) with ESMTPS id C7662C21D80\n\tfor <u-boot@lists.denx.de>; Sun, 17 Sep 2017 22:59:34 +0000 (UTC)","by mail-io0-f176.google.com with SMTP id v36so14911361ioi.1\n\tfor <u-boot@lists.denx.de>; Sun, 17 Sep 2017 15:59:34 -0700 (PDT)","from kiwi.bld.corp.google.com ([100.101.164.89])\n\tby smtp.gmail.com with ESMTPSA id\n\tv204sm6882748oie.17.2017.09.17.15.59.32\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tSun, 17 Sep 2017 15:59:32 -0700 (PDT)","by kiwi.bld.corp.google.com (Postfix, from userid 121222)\n\tid CE56014052F; Sun, 17 Sep 2017 16:59:31 -0600 (MDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_MSPIKE_H2,\n\tT_DKIM_INVALID autolearn=unavailable autolearn_force=no\n\tversion=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n\ts=20161025; \n\th=sender:from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=ikM2QFH7wVImbdhfRjWFnRWg3Uc/i+hU3aGT1bvvUVk=;\n\tb=lelRl1/E3j7HsTVqjjN8exRzeXR4fT3a2bYe66kIRVuctAA5YiM99g/H9jmymp8FqJ\n\twqAuTfW7IBxpjEmNvz9dEk8KeYA/JjVgBg6GffySYPuxah76s7wpyYpA/kD1IWCNltwe\n\t7eGQmlLe5c+YHKRNJGjStjJQzAO5Yy5F1NFU5nsPAa520V84aBYN1EI00ECnL494VjAn\n\tUD/Ftjha/manM7ORUhJywuDGPVSNzg2+ozZ37iVZdd+M0ke4ewZVscIguJpHcgB/OXSi\n\tXLzxir8D9L0XE0GlT+inDoru/H4UhwqX80dlEgKww0dQIF0UAbLcvH2zEi3n592zqvY1\n\t5tqg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:sender:from:to:cc:subject:date:message-id\n\t:in-reply-to:references;\n\tbh=ikM2QFH7wVImbdhfRjWFnRWg3Uc/i+hU3aGT1bvvUVk=;\n\tb=gjk8moldH5rlnGrbutKiLy4+xsHHwhH3/0ZmZlrrZgGAbaM4uoQ40WxdyY+J1tPtGL\n\tPbDTmVUNPr7ZoCqlM4/Ig2CYjjUn5h6JwyJ0eAD1slPIAkDLXtQBycxwdp1frNmiYnXt\n\to4s4KKC0HUCr5stGo7myWYjKMLbVVWbiSTzfyNWnzOvxjfPnAzitc2N1p0JOjoLa7qUY\n\tXdhVsE7znJzWioiRN8zEjhwGxTuzgEK27adIu/v/E/vXM1NNJ8mrtnrwBel7r2nV0tR0\n\tBZiMMrzkpEOpgu6uB4nRG+yK5CrizIo45Os8KnMA5Rtimy4fC8RxpGN0NC8JGgiuX0fp\n\t9hsQ==","X-Gm-Message-State":"AHPjjUi31b5ychdPbAAH7m+4Q0cGkJad3dX8YJOus8N06cSh0e+eOSpK\n\tWW8LtzB2L6v9FLf3","X-Google-Smtp-Source":"AOwi7QCMYxImZyjH1hPKvlOmKujpQgLmvDqSrjRmmhUGKPheqI+EzCRUyFLTI//ODDLejewN45eWvA==","X-Received":"by 10.202.75.211 with SMTP id y202mr4455969oia.140.1505689173490;\n\tSun, 17 Sep 2017 15:59:33 -0700 (PDT)","From":"Simon Glass <sjg@chromium.org>","To":"U-Boot Mailing List <u-boot@lists.denx.de>","Date":"Sun, 17 Sep 2017 16:59:13 -0600","Message-Id":"<20170917225927.117917-3-sjg@chromium.org>","X-Mailer":"git-send-email 2.14.1.690.gbb1197296e-goog","In-Reply-To":"<20170917225927.117917-1-sjg@chromium.org>","References":"<20170917225927.117917-1-sjg@chromium.org>","Cc":"Andy Shevchenko <andriy.shevchenko@linux.intel.com>,\n\tHeinrich Schuchardt <xypron.glpk@gmx.de>","Subject":"[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>","MIME-Version":"1.0","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>"},"content":"Rather than having the caller check this variable and the callee set it,\nmove all access to the variable inside the function. This reduces the\nlogic needed to call efi_init_obj_list().\n\nSigned-off-by: Simon Glass <sjg@chromium.org>\n---\n\n cmd/bootefi.c | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)","diff":"diff --git a/cmd/bootefi.c b/cmd/bootefi.c\nindex 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","prefixes":["U-Boot","02/16"]}