diff mbox series

[v9,5/9] efi_loader: add missing const classifier for event service

Message ID 20231102064459.3466953-6-masahisa.kojima@linaro.org
State Superseded
Headers show
Series Add EFI HTTP boot support | expand

Commit Message

Masahisa Kojima Nov. 2, 2023, 6:44 a.m. UTC
const classifier is missing in EventGroup parameter of
CreateEventEx(). Fix it to remove the compiler warning.

NotifyContext parameter of CreateEventEx() is also defined
with const in UEFI specification, but NotifyContext parameter
of CreateEvent() is defined without const.
Since current implementation calls the common efi_create_event()
function from both CreateEventEx() and CreateEvent() services,
NotifyContext parameter leaves as is.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
---
 include/efi_api.h             | 2 +-
 include/efi_loader.h          | 2 +-
 lib/efi_loader/efi_boottime.c | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

Comments

Ilias Apalodimas Nov. 2, 2023, 8:41 a.m. UTC | #1
On Thu, 2 Nov 2023 at 08:46, Masahisa Kojima <masahisa.kojima@linaro.org> wrote:
>
> const classifier is missing in EventGroup parameter of
> CreateEventEx(). Fix it to remove the compiler warning.
>
> NotifyContext parameter of CreateEventEx() is also defined
> with const in UEFI specification, but NotifyContext parameter
> of CreateEvent() is defined without const.
> Since current implementation calls the common efi_create_event()
> function from both CreateEventEx() and CreateEvent() services,
> NotifyContext parameter leaves as is.
>
> Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
> ---
>  include/efi_api.h             | 2 +-
>  include/efi_loader.h          | 2 +-
>  lib/efi_loader/efi_boottime.c | 4 ++--
>  3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/include/efi_api.h b/include/efi_api.h
> index 8f5ef5f680..c2d6964467 100644
> --- a/include/efi_api.h
> +++ b/include/efi_api.h
> @@ -192,7 +192,7 @@ struct efi_boot_services {
>                                         struct efi_event *event,
>                                         void *context),
>                                 void *notify_context,
> -                               efi_guid_t *event_group,
> +                               const efi_guid_t *event_group,
>                                 struct efi_event **event);
>  };
>
> diff --git a/include/efi_loader.h b/include/efi_loader.h
> index e24410505f..e164e6067d 100644
> --- a/include/efi_loader.h
> +++ b/include/efi_loader.h
> @@ -685,7 +685,7 @@ efi_status_t efi_create_event(uint32_t type, efi_uintn_t notify_tpl,
>                               void (EFIAPI *notify_function) (
>                                         struct efi_event *event,
>                                         void *context),
> -                             void *notify_context, efi_guid_t *group,
> +                             void *notify_context, const efi_guid_t *group,
>                               struct efi_event **event);
>  /* Call this to set a timer */
>  efi_status_t efi_set_timer(struct efi_event *event, enum efi_timer_delay type,
> diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
> index 0b7579cb5a..f9b10a9763 100644
> --- a/lib/efi_loader/efi_boottime.c
> +++ b/lib/efi_loader/efi_boottime.c
> @@ -712,7 +712,7 @@ efi_status_t efi_create_event(uint32_t type, efi_uintn_t notify_tpl,
>                               void (EFIAPI *notify_function) (
>                                         struct efi_event *event,
>                                         void *context),
> -                             void *notify_context, efi_guid_t *group,
> +                             void *notify_context, const efi_guid_t *group,
>                               struct efi_event **event)
>  {
>         struct efi_event *evt;
> @@ -790,7 +790,7 @@ efi_status_t EFIAPI efi_create_event_ex(uint32_t type, efi_uintn_t notify_tpl,
>                                                         struct efi_event *event,
>                                                         void *context),
>                                         void *notify_context,
> -                                       efi_guid_t *event_group,
> +                                       const efi_guid_t *event_group,
>                                         struct efi_event **event)
>  {
>         efi_status_t ret;
> --
> 2.34.1
>

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
diff mbox series

Patch

diff --git a/include/efi_api.h b/include/efi_api.h
index 8f5ef5f680..c2d6964467 100644
--- a/include/efi_api.h
+++ b/include/efi_api.h
@@ -192,7 +192,7 @@  struct efi_boot_services {
 					struct efi_event *event,
 					void *context),
 				void *notify_context,
-				efi_guid_t *event_group,
+				const efi_guid_t *event_group,
 				struct efi_event **event);
 };
 
diff --git a/include/efi_loader.h b/include/efi_loader.h
index e24410505f..e164e6067d 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -685,7 +685,7 @@  efi_status_t efi_create_event(uint32_t type, efi_uintn_t notify_tpl,
 			      void (EFIAPI *notify_function) (
 					struct efi_event *event,
 					void *context),
-			      void *notify_context, efi_guid_t *group,
+			      void *notify_context, const efi_guid_t *group,
 			      struct efi_event **event);
 /* Call this to set a timer */
 efi_status_t efi_set_timer(struct efi_event *event, enum efi_timer_delay type,
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 0b7579cb5a..f9b10a9763 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -712,7 +712,7 @@  efi_status_t efi_create_event(uint32_t type, efi_uintn_t notify_tpl,
 			      void (EFIAPI *notify_function) (
 					struct efi_event *event,
 					void *context),
-			      void *notify_context, efi_guid_t *group,
+			      void *notify_context, const efi_guid_t *group,
 			      struct efi_event **event)
 {
 	struct efi_event *evt;
@@ -790,7 +790,7 @@  efi_status_t EFIAPI efi_create_event_ex(uint32_t type, efi_uintn_t notify_tpl,
 							struct efi_event *event,
 							void *context),
 					void *notify_context,
-					efi_guid_t *event_group,
+					const efi_guid_t *event_group,
 					struct efi_event **event)
 {
 	efi_status_t ret;