[{"id":1769860,"web_url":"http://patchwork.ozlabs.org/comment/1769860/","msgid":"<e8f02600-8950-dceb-5441-bee6be9e8dbf@gmx.de>","list_archive_url":null,"date":"2017-09-18T04:02:14","subject":"Re: [U-Boot] [PATCH 01/16] efi: Update efi_smbios_register() to\n\treturn error code","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> This function can fail but gives no indication of failure. Update it to\n> return an error when something goes wrong.\n> \n> Signed-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(-)\n> \n> diff --git a/include/efi_loader.h b/include/efi_loader.h\n> index 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);\n> diff --git a/lib/efi_loader/efi_smbios.c b/lib/efi_loader/efi_smbios.c\n> index 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\nPlease, use efi_status_t as return type.\n\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\nUse\treturn EFI_OUT_OF_RESOURCES\nThis matches the value returned by efi_install_configuration_table.\n\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\nThis function can return EFI_OUT_OF_RESOURCES.\n\n> +\n> +\treturn 0;\n\nUse\treturn EFI_SUCCESS;\n\nRegards Heinrich\n\n>  }\n>","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 3xwXQt6W5Kz9s7F\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 18 Sep 2017 14:02:46 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid A854EC21EF8; Mon, 18 Sep 2017 04:02:40 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 394E7C21D57;\n\tMon, 18 Sep 2017 04:02:38 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 7BB2EC21D57; Mon, 18 Sep 2017 04:02:36 +0000 (UTC)","from mout.gmx.net (mout.gmx.net [212.227.17.22])\n\tby lists.denx.de (Postfix) with ESMTPS id 2DA9BC21D19\n\tfor <u-boot@lists.denx.de>; Mon, 18 Sep 2017 04:02:36 +0000 (UTC)","from [192.168.123.58] ([84.118.154.110]) by mail.gmx.com (mrgmx103\n\t[212.227.17.168]) with ESMTPSA (Nemesis) id\n\t0MQih7-1dyzFW0LbZ-00U0GA; Mon, 18 Sep 2017 06:02:19 +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,\n\tRCVD_IN_MSPIKE_H2 autolearn=unavailable autolearn_force=no\n\tversion=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-2-sjg@chromium.org>","From":"Heinrich Schuchardt <xypron.glpk@gmx.de>","Message-ID":"<e8f02600-8950-dceb-5441-bee6be9e8dbf@gmx.de>","Date":"Mon, 18 Sep 2017 06:02:14 +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-2-sjg@chromium.org>","Content-Language":"en-US","X-Provags-ID":"V03:K0:QV7sr7iWpcgOf2yVV/dEAd3ZdjPqrnJNmVFeU7yV821l0PaqjOT\n\tRVqFNLNm/3ASHlZ5M1ojXOD8NrSX1H/5jBWETStnHT4+Qu6z3gTet+YBZbUYjcqJTGny0T8\n\t53yWOZnbGfcFXkWJ7bBTFZ/EVQa7oGq9pmHMneLYNHLP/fdT6IvmB3b4Zb6MtCunw3jnOOs\n\t8pXLqjRo9WXlF/jDwCfnw==","X-UI-Out-Filterresults":"notjunk:1; V01:K0:tWnw0UyeatY=:CUjuv5Y7R56KgzgLCUSKha\n\tFo8I/Hhu4G6fa0bp/YP8WyHV9YgthZlMfc17w7TvI6ykWWK/6sylehcJe1tZVftgDC7NoZaKE\n\touh77Zlfxm5nB/n01Ujuh9L90HOSd0rO9BAEhSXEdMb+p5mv/dnD4VYayquBC/ihoq6CQFonP\n\tKf99hoBlMkaHwBLXWdfridwUmKADYtQICK9OJzZoiOg3tRIIqoHyoqcmIj/sHxiLsfH5QQU4V\n\teINIwWiCDtPpOhZay5Sc72kj3XYZufz8vXJNrB/zWSTjWwZH7GKWjw8QfeyT0l4+VLUwUM63n\n\txkCWZ1qZ+x4lHw6plHEuKH9/Oze3bVjzHzokOFZiY/yc+Bg2bqoxj82ZyyPBPDiHG30wB2XBf\n\tc25d8RRRowcXIVb19kFGDiNXx9gyb/C9nxIXiy6zfhOyMNRX9HsEJ0t8L5sjZRZ4z9oY8iPl2\n\tQlSdIgI9hpYSvr2NUiKjSloqsK2M5tEn616cHsr5qGAEpDC2KWs9ZfgNVg0jjr9vg1up360bY\n\t5EyNq+sPII63HeEjOzZnFFN4Pzzd8/nLjaqqxofnT9YKL+/rRUHQR2RU8rs1W23Iw7LuUls1L\n\tXaYQJfeixlh+/I2Dh6VLBPIvseoFPwBBGJO4/0iX5vJv02vCMRW3hJqHlW5yhjrmuhXFeUn15\n\tEfkZ8Gr9G9VZmI5+m6yQlyXkP8Guwytcl+a9vWe+qSh5GlZormegqJnB+34XLt8Z2FwP38wQM\n\tjULRhDn7I/KHsqcpHmJK3jy1b+0czPBHw1Kf5x7ptjmUgCzzHl1D7xICqO1zUUGb3zy3iS/Ii\n\t2l3Pmjz0B7bBlPtCid/5/uPvEA+NDpfXn+g73nIznkkkJ9ZYHg=","Cc":"Andy Shevchenko <andriy.shevchenko@linux.intel.com>","Subject":"Re: [U-Boot] [PATCH 01/16] efi: Update efi_smbios_register() to\n\treturn error 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>","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>"}}]