{"id":806175,"url":"http://patchwork.ozlabs.org/api/patches/806175/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20170826225328.7550-5-xypron.glpk@gmx.de/","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":"<20170826225328.7550-5-xypron.glpk@gmx.de>","list_archive_url":null,"date":"2017-08-26T22:53:23","name":"[U-Boot,14/23] efi_loader: pass GUIDs as const efi_guid_t *","commit_ref":null,"pull_url":null,"state":"superseded","archived":true,"hash":"b32dd5d031eea819ec6b1376e81a1e9ef43da232","submitter":{"id":61270,"url":"http://patchwork.ozlabs.org/api/people/61270/?format=json","name":"Heinrich Schuchardt","email":"xypron.glpk@gmx.de"},"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/20170826225328.7550-5-xypron.glpk@gmx.de/mbox/","series":[],"comments":"http://patchwork.ozlabs.org/api/patches/806175/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/806175/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>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xftlN41dyz9sN5\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 27 Aug 2017 08:59:44 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 5B739C2215D; Sat, 26 Aug 2017 22:57:44 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id D4E5EC221BB;\n\tSat, 26 Aug 2017 22:57:37 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid F27DFC221F1; Sat, 26 Aug 2017 22:54:26 +0000 (UTC)","from mout.gmx.net (mout.gmx.net [212.227.17.21])\n\tby lists.denx.de (Postfix) with ESMTPS id 508B3C2216B\n\tfor <u-boot@lists.denx.de>; Sat, 26 Aug 2017 22:54:22 +0000 (UTC)","from localhost.localdomain ([84.118.154.110]) by mail.gmx.com\n\t(mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id\n\t0LcSWg-1d5Drb1GYo-00jsPk; Sun, 27 Aug 2017 00:53:37 +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","From":"Heinrich Schuchardt <xypron.glpk@gmx.de>","To":"Alexander Graf <agraf@suse.de>","Date":"Sun, 27 Aug 2017 00:53:23 +0200","Message-Id":"<20170826225328.7550-5-xypron.glpk@gmx.de>","X-Mailer":"git-send-email 2.14.1","In-Reply-To":"<20170826225328.7550-1-xypron.glpk@gmx.de>","References":"<20170826225110.7381-1-xypron.glpk@gmx.de>\n\t<20170826225328.7550-1-xypron.glpk@gmx.de>","X-Provags-ID":"V03:K0:qnMMi2AG0qf1BrvKkfoElMr9yPx7oQzSOaYrML1N2R+JHYBoICQ\n\tP891k4nvzMOkFHHG2So7P1Mvaz/UUKORDUfcunMbR3icA33UAOMrbLj1QDqkI3aiVEFj0TY\n\tOtZLd+EW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ot@lists.denx.de","Subject":"[U-Boot] [PATCH 14/23] efi_loader: pass GUIDs as const efi_guid_t *","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":"We need to call some boottime services internally.\nOur GUIDs are stored as const efi_guid_t *.\n\nThe boottime services never change GUIDs.\nSo we can define the parameters as const efi_guid_t *.\n\nSigned-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>\n---\n include/efi_api.h             | 44 +++++++++++++++++++++----------------------\n include/efi_loader.h          |  4 ++--\n lib/efi_loader/efi_boottime.c | 37 ++++++++++++++++++------------------\n 3 files changed, 43 insertions(+), 42 deletions(-)","diff":"diff --git a/include/efi_api.h b/include/efi_api.h\nindex ec1b321e8e..8efc8dfab8 100644\n--- a/include/efi_api.h\n+++ b/include/efi_api.h\n@@ -74,25 +74,25 @@ struct efi_boot_services {\n \tefi_status_t (EFIAPI *close_event)(struct efi_event *event);\n \tefi_status_t (EFIAPI *check_event)(struct efi_event *event);\n #define EFI_NATIVE_INTERFACE\t0x00000000\n-\tefi_status_t (EFIAPI *install_protocol_interface)(\n-\t\t\tvoid **handle, efi_guid_t *protocol,\n+\tefi_status_t (EFIAPI * install_protocol_interface)(\n+\t\t\tvoid **handle, const efi_guid_t *protocol,\n \t\t\tint protocol_interface_type, void *protocol_interface);\n-\tefi_status_t (EFIAPI *reinstall_protocol_interface)(\n-\t\t\tvoid *handle, efi_guid_t *protocol,\n+\tefi_status_t (EFIAPI * reinstall_protocol_interface)(\n+\t\t\tvoid *handle, const efi_guid_t *protocol,\n \t\t\tvoid *old_interface, void *new_interface);\n-\tefi_status_t (EFIAPI *uninstall_protocol_interface)(void *handle,\n-\t\t\tefi_guid_t *protocol, void *protocol_interface);\n-\tefi_status_t (EFIAPI *handle_protocol)(efi_handle_t, efi_guid_t *,\n-\t\t\t\t\t       void **);\n+\tefi_status_t (EFIAPI * uninstall_protocol_interface)(void *handle,\n+\t\t\tconst efi_guid_t *protocol, void *protocol_interface);\n+\tefi_status_t (EFIAPI * handle_protocol)(efi_handle_t,\n+\t\t\t\t\t\tconst efi_guid_t *, void **);\n \tvoid *reserved;\n-\tefi_status_t (EFIAPI *register_protocol_notify)(\n-\t\t\tefi_guid_t *protocol, struct efi_event *event,\n+\tefi_status_t (EFIAPI * register_protocol_notify)(\n+\t\t\tconst efi_guid_t *protocol, struct efi_event *event,\n \t\t\tvoid **registration);\n-\tefi_status_t (EFIAPI *locate_handle)(\n+\tefi_status_t (EFIAPI * locate_handle)(\n \t\t\tenum efi_locate_search_type search_type,\n-\t\t\tefi_guid_t *protocol, void *search_key,\n+\t\t\tconst efi_guid_t *protocol, void *search_key,\n \t\t\tunsigned long *buffer_size, efi_handle_t *buffer);\n-\tefi_status_t (EFIAPI *locate_device_path)(efi_guid_t *protocol,\n+\tefi_status_t (EFIAPI * locate_device_path)(const efi_guid_t *protocol,\n \t\t\tstruct efi_device_path **device_path,\n \t\t\tefi_handle_t *device);\n \tefi_status_t (EFIAPI *install_configuration_table)(\n@@ -128,25 +128,25 @@ struct efi_boot_services {\n #define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008\n #define EFI_OPEN_PROTOCOL_BY_DRIVER           0x00000010\n #define EFI_OPEN_PROTOCOL_EXCLUSIVE           0x00000020\n-\tefi_status_t (EFIAPI *open_protocol)(efi_handle_t handle,\n-\t\t\tefi_guid_t *protocol, void **interface,\n+\tefi_status_t (EFIAPI * open_protocol)(efi_handle_t handle,\n+\t\t\tconst efi_guid_t *protocol, void **interface,\n \t\t\tefi_handle_t agent_handle,\n \t\t\tefi_handle_t controller_handle, u32 attributes);\n-\tefi_status_t (EFIAPI *close_protocol)(void *handle,\n-\t\t\tefi_guid_t *protocol, void *agent_handle,\n+\tefi_status_t (EFIAPI * close_protocol)(void *handle,\n+\t\t\tconst efi_guid_t *protocol, void *agent_handle,\n \t\t\tvoid *controller_handle);\n-\tefi_status_t(EFIAPI *open_protocol_information)(efi_handle_t handle,\n-\t\t\tefi_guid_t *protocol,\n+\tefi_status_t(EFIAPI * open_protocol_information)(efi_handle_t handle,\n+\t\t\tconst efi_guid_t *protocol,\n \t\t\tstruct efi_open_protocol_info_entry **entry_buffer,\n \t\t\tunsigned long *entry_count);\n \tefi_status_t (EFIAPI *protocols_per_handle)(efi_handle_t handle,\n \t\t\tefi_guid_t ***protocol_buffer,\n \t\t\tunsigned long *protocols_buffer_count);\n-\tefi_status_t (EFIAPI *locate_handle_buffer) (\n+\tefi_status_t (EFIAPI * locate_handle_buffer) (\n \t\t\tenum efi_locate_search_type search_type,\n-\t\t\tefi_guid_t *protocol, void *search_key,\n+\t\t\tconst efi_guid_t *protocol, void *search_key,\n \t\t\tunsigned long *no_handles, efi_handle_t **buffer);\n-\tefi_status_t (EFIAPI *locate_protocol)(efi_guid_t *protocol,\n+\tefi_status_t (EFIAPI * locate_protocol)(const efi_guid_t *protocol,\n \t\t\tvoid *registration, void **protocol_interface);\n \tefi_status_t (EFIAPI *install_multiple_protocol_interfaces)(\n \t\t\tvoid **handle, ...);\ndiff --git a/include/efi_loader.h b/include/efi_loader.h\nindex 2a98bf66b8..9c68246c7c 100644\n--- a/include/efi_loader.h\n+++ b/include/efi_loader.h\n@@ -182,12 +182,12 @@ efi_status_t efi_set_timer(struct efi_event *event, enum efi_timer_delay type,\n /* Call this to signal an event */\n void efi_signal_event(struct efi_event *event);\n /* Call this with EFI_CALL to close a protocol */\n-efi_status_t EFIAPI efi_close_protocol(void *handle, efi_guid_t *protocol,\n+efi_status_t EFIAPI efi_close_protocol(void *handle, const efi_guid_t *protocol,\n \t\t\t\t       void *agent_handle,\n \t\t\t\t       void *controller_handle);\n /* Call this with EFI_CALL to open a protocol */\n efi_status_t EFIAPI efi_open_protocol(\n-\t\t\tvoid *handle, efi_guid_t *protocol,\n+\t\t\tvoid *handle, const efi_guid_t *protocol,\n \t\t\tvoid **protocol_interface, void *agent_handle,\n \t\t\tvoid *controller_handle, uint32_t attributes);\n \ndiff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c\nindex ad8733d3e5..5a73ea5cd0 100644\n--- a/lib/efi_loader/efi_boottime.c\n+++ b/lib/efi_loader/efi_boottime.c\n@@ -470,7 +470,8 @@ static efi_status_t EFIAPI efi_check_event(struct efi_event *event)\n \treturn EFI_EXIT(EFI_INVALID_PARAMETER);\n }\n \n-static efi_status_t efi_search_protocol(void *handle, efi_guid_t *protocol_guid,\n+static efi_status_t efi_search_protocol(void *handle,\n+\t\t\t\t\tconst efi_guid_t *protocol_guid,\n \t\t\t\t\tstruct efi_handler **handler)\n {\n \tstruct efi_object *efiobj;\n@@ -496,7 +497,7 @@ static efi_status_t efi_search_protocol(void *handle, efi_guid_t *protocol_guid,\n }\n \n static efi_status_t EFIAPI efi_install_protocol_interface(void **handle,\n-\t\t\tefi_guid_t *protocol, int protocol_interface_type,\n+\t\t\tconst efi_guid_t *protocol, int protocol_interface_type,\n \t\t\tvoid *protocol_interface)\n {\n \tint i;\n@@ -551,7 +552,7 @@ out:\n }\n \n static efi_status_t EFIAPI efi_reinstall_protocol_interface(void *handle,\n-\t\t\tefi_guid_t *protocol, void *old_interface,\n+\t\t\tconst efi_guid_t *protocol, void *old_interface,\n \t\t\tvoid *new_interface)\n {\n \tEFI_ENTRY(\"%p, %p, %p, %p\", handle, protocol, old_interface,\n@@ -560,7 +561,7 @@ static efi_status_t EFIAPI efi_reinstall_protocol_interface(void *handle,\n }\n \n static efi_status_t EFIAPI efi_uninstall_protocol_interface(void *handle,\n-\t\t\tefi_guid_t *protocol, void *protocol_interface)\n+\t\t\tconst efi_guid_t *protocol, void *protocol_interface)\n {\n \tstruct efi_handler *handler;\n \tefi_status_t r;\n@@ -589,16 +590,16 @@ out:\n \treturn EFI_EXIT(r);\n }\n \n-static efi_status_t EFIAPI efi_register_protocol_notify(efi_guid_t *protocol,\n-\t\t\t\t\t\t\tstruct efi_event *event,\n-\t\t\t\t\t\t\tvoid **registration)\n+static efi_status_t EFIAPI efi_register_protocol_notify(\n+\t\t\tconst efi_guid_t *protocol, struct efi_event *event,\n+\t\t\tvoid **registration)\n {\n \tEFI_ENTRY(\"%p, %p, %p\", protocol, event, registration);\n \treturn EFI_EXIT(EFI_OUT_OF_RESOURCES);\n }\n \n static int efi_search(enum efi_locate_search_type search_type,\n-\t\t      efi_guid_t *protocol, void *search_key,\n+\t\t      const efi_guid_t *protocol, void *search_key,\n \t\t      struct efi_object *efiobj)\n {\n \tint i;\n@@ -623,7 +624,7 @@ static int efi_search(enum efi_locate_search_type search_type,\n \n static efi_status_t efi_locate_handle(\n \t\t\tenum efi_locate_search_type search_type,\n-\t\t\tefi_guid_t *protocol, void *search_key,\n+\t\t\tconst efi_guid_t *protocol, void *search_key,\n \t\t\tunsigned long *buffer_size, efi_handle_t *buffer)\n {\n \tstruct efi_object *efiobj;\n@@ -680,7 +681,7 @@ static efi_status_t efi_locate_handle(\n \n static efi_status_t EFIAPI efi_locate_handle_ext(\n \t\t\tenum efi_locate_search_type search_type,\n-\t\t\tefi_guid_t *protocol, void *search_key,\n+\t\t\tconst efi_guid_t *protocol, void *search_key,\n \t\t\tunsigned long *buffer_size, efi_handle_t *buffer)\n {\n \tEFI_ENTRY(\"%d, %p, %p, %p, %p\", search_type, protocol, search_key,\n@@ -690,7 +691,7 @@ static efi_status_t EFIAPI efi_locate_handle_ext(\n \t\t\tbuffer_size, buffer));\n }\n \n-static efi_status_t EFIAPI efi_locate_device_path(efi_guid_t *protocol,\n+static efi_status_t EFIAPI efi_locate_device_path(const efi_guid_t *protocol,\n \t\t\tstruct efi_device_path **device_path,\n \t\t\tefi_handle_t *device)\n {\n@@ -939,7 +940,7 @@ static efi_status_t EFIAPI efi_disconnect_controller(void *controller_handle,\n \treturn EFI_EXIT(EFI_INVALID_PARAMETER);\n }\n \n-efi_status_t EFIAPI efi_close_protocol(void *handle, efi_guid_t *protocol,\n+efi_status_t EFIAPI efi_close_protocol(void *handle, const efi_guid_t *protocol,\n \t\t\t\t       void *agent_handle,\n \t\t\t\t       void *controller_handle)\n {\n@@ -980,7 +981,7 @@ out:\n }\n \n static efi_status_t EFIAPI efi_open_protocol_information(efi_handle_t handle,\n-\t\t\tefi_guid_t *protocol,\n+\t\t\tconst efi_guid_t *protocol,\n \t\t\tstruct efi_open_protocol_info_entry **entry_buffer,\n \t\t\tunsigned long *entry_count)\n {\n@@ -1097,7 +1098,7 @@ static efi_status_t EFIAPI efi_protocols_per_handle(void *handle,\n \n static efi_status_t EFIAPI efi_locate_handle_buffer(\n \t\t\tenum efi_locate_search_type search_type,\n-\t\t\tefi_guid_t *protocol, void *search_key,\n+\t\t\tconst efi_guid_t *protocol, void *search_key,\n \t\t\tunsigned long *no_handles, efi_handle_t **buffer)\n {\n \tefi_status_t r;\n@@ -1128,7 +1129,7 @@ out:\n \treturn EFI_EXIT(r);\n }\n \n-static efi_status_t EFIAPI efi_locate_protocol(efi_guid_t *protocol,\n+static efi_status_t EFIAPI efi_locate_protocol(const efi_guid_t *protocol,\n \t\t\t\t\t       void *registration,\n \t\t\t\t\t       void **protocol_interface)\n {\n@@ -1167,7 +1168,7 @@ static efi_status_t EFIAPI efi_install_multiple_protocol_interfaces(\n \tEFI_ENTRY(\"%p\", handle);\n \n \tva_list argptr;\n-\tefi_guid_t *protocol;\n+\tconst efi_guid_t *protocol;\n \tvoid *protocol_interface;\n \tefi_status_t r = EFI_SUCCESS;\n \tint i = 0;\n@@ -1326,7 +1327,7 @@ static efi_status_t efi_protocol_open(\n }\n \n efi_status_t EFIAPI efi_open_protocol(\n-\t\t\tvoid *handle, efi_guid_t *protocol,\n+\t\t\tvoid *handle, const efi_guid_t *protocol,\n \t\t\tvoid **protocol_interface, void *agent_handle,\n \t\t\tvoid *controller_handle, uint32_t attributes)\n {\n@@ -1372,7 +1373,7 @@ out:\n }\n \n static efi_status_t EFIAPI efi_handle_protocol(void *handle,\n-\t\t\t\t\t       efi_guid_t *protocol,\n+\t\t\t\t\t       const efi_guid_t *protocol,\n \t\t\t\t\t       void **protocol_interface)\n {\n \treturn efi_open_protocol(handle, protocol, protocol_interface, NULL,\n","prefixes":["U-Boot","14/23"]}