{"id":814719,"url":"http://patchwork.ozlabs.org/api/patches/814719/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20170917225927.117917-2-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-2-sjg@chromium.org>","list_archive_url":null,"date":"2017-09-17T22:59:12","name":"[U-Boot,01/16] efi: Update efi_smbios_register() to return error code","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"4721dd19c59edec6ceb4b5589d7d18672ebe83ba","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-2-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/814719/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/814719/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=\"OPjMdmWt\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xwQSj3gvzz9s7c\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 18 Sep 2017 09:33:57 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 3CF96C21CB6; Sun, 17 Sep 2017 23:33:56 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 44921C21D80;\n\tSun, 17 Sep 2017 23:00:54 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 5D84AC21D93; Sun, 17 Sep 2017 23:00:52 +0000 (UTC)","from mail-io0-f180.google.com (mail-io0-f180.google.com\n\t[209.85.223.180])\n\tby lists.denx.de (Postfix) with ESMTPS id F13F9C21D93\n\tfor <u-boot@lists.denx.de>; Sun, 17 Sep 2017 22:59:33 +0000 (UTC)","by mail-io0-f180.google.com with SMTP id g32so14832540ioj.2\n\tfor <u-boot@lists.denx.de>; Sun, 17 Sep 2017 15:59:33 -0700 (PDT)","from kiwi.bld.corp.google.com ([2620:0:10f2:0:50ee:364d:633f:bd4e])\n\tby smtp.gmail.com with ESMTPSA id\n\tk124sm10221814oib.0.2017.09.17.15.59.31\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tSun, 17 Sep 2017 15:59:31 -0700 (PDT)","by kiwi.bld.corp.google.com (Postfix, from userid 121222)\n\tid F10651417F3; Sun, 17 Sep 2017 16:59:30 -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=fgjNkvQOhR8AZNZyUktBO4m8z7VW3dYzbK+87HoNkX4=;\n\tb=OPjMdmWtHvWkJp7MkXknBnS9bfqH9sFpS+MPF7mv/18DoLiQ/hgupgmEAQV4/NEne+\n\tGEf6ZGWt3H34ErLbMaHrdVr30gkpPLwjneZzExKcGap4XJYsDnKZ+b/NPSivCDRLaphb\n\tqFbJhNpBjNRyYSrUls1VX1G6S/ULt69uHwsLqbxjU2OXKJO0ibQ3UYoyTJngYqQ7Vfcg\n\thuRjVNPISXFo32aGMv6OsYZ3sICD04gUG8OntTysYaXbr0z5q2f8/OOU8x7MvanYxitg\n\tGcdjZgDw5a3P+cF+D0WndJfCC3fPqfz8+/Z39Yd4Dg+WxKxne9w6K+Nq/nzzqjAELb46\n\tu8YA==","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=fgjNkvQOhR8AZNZyUktBO4m8z7VW3dYzbK+87HoNkX4=;\n\tb=p/aupmWSNQ2y4rdOoXWCnm6ndjCD3i+YDxzbaK15Mz1xJGj0eFxTYSpFX0U+C1gv9z\n\ttADONoKUmIjpH35P0pNs5I03Xi+Qs7aaxcBZmJLOWEsqdBQHGgGxemqCyjxlebfnLsGs\n\tZgw79mWZfCmi2ymIJOhnLTfLFXYRJGZuAJXb02o9zpOpQ6TJG+h6MVJT20rlFj0vnsfk\n\tXBXL7Fb9MKCHXGRCPh/0B05iQHO7sPL14/SKEfUlxTY5CX0KqzqSthSaEmpiUZ74bHKM\n\t+H87Kh4xVIFLL4aUMaHVtWgsYC4ZsBXmU6NahoG/iip58ViPBRfCCft4Rx5DxxkHtbMB\n\t/8zA==","X-Gm-Message-State":"AHPjjUhZRuRZECWgKgoZ0S90wD0mwp3wJkXQ7WO2fjuy8Nh7y9NNXYi2\n\t306UFbLyy6WT99VP","X-Google-Smtp-Source":"AOwi7QA2R0f49qBxtR/BdRKpQT61EhHrXsK0AkA/seYR8QLPA3bRLtMCqAFneEvoF29fNQS60yr+8Q==","X-Received":"by 10.202.236.131 with SMTP id\n\tk125mr9626820oih.313.1505689172571; \n\tSun, 17 Sep 2017 15:59:32 -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:12 -0600","Message-Id":"<20170917225927.117917-2-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 01/16] efi: Update efi_smbios_register() to return\n\terror code","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":"This function can fail but gives no indication of failure. Update it to\nreturn an error when something goes wrong.\n\nSigned-off-by: Simon Glass <sjg@chromium.org>\n---\n\n include/efi_loader.h        | 10 ++++++++--\n lib/efi_loader/efi_smbios.c |  6 ++++--\n 2 files changed, 12 insertions(+), 4 deletions(-)","diff":"diff --git a/include/efi_loader.h b/include/efi_loader.h\nindex 2051fc994e..79d2dad22c 100644\n--- a/include/efi_loader.h\n+++ b/include/efi_loader.h\n@@ -150,8 +150,14 @@ int efi_disk_register(void);\n int efi_gop_register(void);\n /* Called by bootefi to make the network interface available */\n int efi_net_register(void **handle);\n-/* Called by bootefi to make SMBIOS tables available */\n-void efi_smbios_register(void);\n+/**\n+ * efi_smbios_register() - write out SMBIOS tables\n+ *\n+ * Called by bootefi to make SMBIOS tables available\n+ *\n+ * @return 0 if OK, -ENOMEM if no memory is available for the tables\n+ */\n+int efi_smbios_register(void);\n \n /* Called by networking code to memorize the dhcp ack package */\n void efi_net_set_dhcp_ack(void *pkt, int len);\ndiff --git a/lib/efi_loader/efi_smbios.c b/lib/efi_loader/efi_smbios.c\nindex ac412e7362..3b87294dc3 100644\n--- a/lib/efi_loader/efi_smbios.c\n+++ b/lib/efi_loader/efi_smbios.c\n@@ -13,7 +13,7 @@\n \n static const efi_guid_t smbios_guid = SMBIOS_TABLE_GUID;\n \n-void efi_smbios_register(void)\n+int efi_smbios_register(void)\n {\n \t/* Map within the low 32 bits, to allow for 32bit SMBIOS tables */\n \tuint64_t dmi = 0xffffffff;\n@@ -22,11 +22,13 @@ void efi_smbios_register(void)\n \tint memtype = EFI_RUNTIME_SERVICES_DATA;\n \n \tif (efi_allocate_pages(1, memtype, pages, &dmi) != EFI_SUCCESS)\n-\t\treturn;\n+\t\treturn -ENOMEM;\n \n \t/* Generate SMBIOS tables */\n \twrite_smbios_table(dmi);\n \n \t/* And expose them to our EFI payload */\n \tefi_install_configuration_table(&smbios_guid, (void*)(uintptr_t)dmi);\n+\n+\treturn 0;\n }\n","prefixes":["U-Boot","01/16"]}