[edk2-devel] [PATCH 12/35] MdeModulePkg: stop abusing EFI_HANDLE for keystroke notify registration

Laszlo Ersek posted 35 patches 6 years, 4 months ago
[edk2-devel] [PATCH 12/35] MdeModulePkg: stop abusing EFI_HANDLE for keystroke notify registration
Posted by Laszlo Ersek 6 years, 4 months ago
EFI_REGISTER_KEYSTROKE_NOTIFY and EFI_UNREGISTER_KEYSTROKE_NOTIFY require
the notification handle to have type (VOID*). The notification handle has
nothing to do with the EFI_HANDLE type.

This change is a semantic fix; functionally, it's a no-op.

Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---

Notes:
    lightly tested: ConSplitterDxe is part of the ArmVirt and OVMF platforms

 MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c | 2 +-
 MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c       | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
index 63c814ae1816..9c38271b65f9 100644
--- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
+++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
@@ -4026,7 +4026,7 @@ ConSplitterTextInRegisterKeyNotify (
   if (NewNotify == NULL) {
     return EFI_OUT_OF_RESOURCES;
   }
-  NewNotify->NotifyHandleList = (EFI_HANDLE *) AllocateZeroPool (sizeof (EFI_HANDLE) *  Private->TextInExListCount);
+  NewNotify->NotifyHandleList = (VOID **) AllocateZeroPool (sizeof (VOID *) *  Private->TextInExListCount);
   if (NewNotify->NotifyHandleList == NULL) {
     gBS->FreePool (NewNotify);
     return EFI_OUT_OF_RESOURCES;
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
index 7cfd5c178861..f98797225b63 100644
--- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
+++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
@@ -143,7 +143,7 @@ InternalStartMonitor(
   EFI_HANDLE                        *Handles;
   UINTN                             HandleCount;
   UINTN                             HandleIndex;
-  EFI_HANDLE                        NotifyHandle;
+  VOID                              *NotifyHandle;
 
   Status = gBS->LocateHandleBuffer (
               ByProtocol,
@@ -202,7 +202,7 @@ InternalStopMonitor(
   EFI_KEY_DATA                      KeyData;
   UINTN                             HandleCount;
   UINTN                             HandleIndex;
-  EFI_HANDLE                        NotifyHandle;
+  VOID                              *NotifyHandle;
 
   Status = gBS->LocateHandleBuffer (
                 ByProtocol,
-- 
2.19.1.3.g30247aa5d201



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#47399): https://edk2.groups.io/g/devel/message/47399
Mute This Topic: https://groups.io/mt/34180213/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH 12/35] MdeModulePkg: stop abusing EFI_HANDLE for keystroke notify registration
Posted by Ni, Ray 6 years, 4 months ago
Reviewed-by: Ray Ni <ray.ni@intel.com>

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Laszlo Ersek
> Sent: Tuesday, September 17, 2019 12:49 PM
> To: edk2-devel-groups-io <devel@edk2.groups.io>
> Cc: Bi, Dandan <dandan.bi@intel.com>; Dong, Eric <eric.dong@intel.com>; Wu, Hao A <hao.a.wu@intel.com>; Wang, Jian J
> <jian.j.wang@intel.com>; Ni, Ray <ray.ni@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>
> Subject: [edk2-devel] [PATCH 12/35] MdeModulePkg: stop abusing EFI_HANDLE for keystroke notify registration
> 
> EFI_REGISTER_KEYSTROKE_NOTIFY and EFI_UNREGISTER_KEYSTROKE_NOTIFY require
> the notification handle to have type (VOID*). The notification handle has
> nothing to do with the EFI_HANDLE type.
> 
> This change is a semantic fix; functionally, it's a no-op.
> 
> Cc: Dandan Bi <dandan.bi@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Zhichao Gao <zhichao.gao@intel.com>
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> ---
> 
> Notes:
>     lightly tested: ConSplitterDxe is part of the ArmVirt and OVMF platforms
> 
>  MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c | 2 +-
>  MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c       | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
> b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
> index 63c814ae1816..9c38271b65f9 100644
> --- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
> +++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
> @@ -4026,7 +4026,7 @@ ConSplitterTextInRegisterKeyNotify (
>    if (NewNotify == NULL) {
>      return EFI_OUT_OF_RESOURCES;
>    }
> -  NewNotify->NotifyHandleList = (EFI_HANDLE *) AllocateZeroPool (sizeof (EFI_HANDLE) *  Private->TextInExListCount);
> +  NewNotify->NotifyHandleList = (VOID **) AllocateZeroPool (sizeof (VOID *) *  Private->TextInExListCount);
>    if (NewNotify->NotifyHandleList == NULL) {
>      gBS->FreePool (NewNotify);
>      return EFI_OUT_OF_RESOURCES;
> diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
> b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
> index 7cfd5c178861..f98797225b63 100644
> --- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
> +++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
> @@ -143,7 +143,7 @@ InternalStartMonitor(
>    EFI_HANDLE                        *Handles;
>    UINTN                             HandleCount;
>    UINTN                             HandleIndex;
> -  EFI_HANDLE                        NotifyHandle;
> +  VOID                              *NotifyHandle;
> 
>    Status = gBS->LocateHandleBuffer (
>                ByProtocol,
> @@ -202,7 +202,7 @@ InternalStopMonitor(
>    EFI_KEY_DATA                      KeyData;
>    UINTN                             HandleCount;
>    UINTN                             HandleIndex;
> -  EFI_HANDLE                        NotifyHandle;
> +  VOID                              *NotifyHandle;
> 
>    Status = gBS->LocateHandleBuffer (
>                  ByProtocol,
> --
> 2.19.1.3.g30247aa5d201
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> 
> View/Reply Online (#47399): https://edk2.groups.io/g/devel/message/47399
> Mute This Topic: https://groups.io/mt/34180213/1712937
> Group Owner: devel+owner@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub  [ray.ni@intel.com]
> -=-=-=-=-=-=


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#47427): https://edk2.groups.io/g/devel/message/47427
Mute This Topic: https://groups.io/mt/34180213/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH 12/35] MdeModulePkg: stop abusing EFI_HANDLE for keystroke notify registration
Posted by Dandan Bi 6 years, 4 months ago
Reviewed-by: Dandan Bi <dandan.bi@intel.com>

Thanks,
Dandan

> -----Original Message-----
> From: Laszlo Ersek [mailto:lersek@redhat.com]
> Sent: Wednesday, September 18, 2019 3:49 AM
> To: edk2-devel-groups-io <devel@edk2.groups.io>
> Cc: Bi, Dandan <dandan.bi@intel.com>; Dong, Eric <eric.dong@intel.com>;
> Wu, Hao A <hao.a.wu@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Ni,
> Ray <ray.ni@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>
> Subject: [PATCH 12/35] MdeModulePkg: stop abusing EFI_HANDLE for
> keystroke notify registration
> 
> EFI_REGISTER_KEYSTROKE_NOTIFY and
> EFI_UNREGISTER_KEYSTROKE_NOTIFY require the notification handle to
> have type (VOID*). The notification handle has nothing to do with the
> EFI_HANDLE type.
> 
> This change is a semantic fix; functionally, it's a no-op.
> 
> Cc: Dandan Bi <dandan.bi@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Zhichao Gao <zhichao.gao@intel.com>
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> ---
> 
> Notes:
>     lightly tested: ConSplitterDxe is part of the ArmVirt and OVMF platforms
> 
>  MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c | 2 +-
>  MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c       | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
> b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
> index 63c814ae1816..9c38271b65f9 100644
> --- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
> +++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
> @@ -4026,7 +4026,7 @@ ConSplitterTextInRegisterKeyNotify (
>    if (NewNotify == NULL) {
>      return EFI_OUT_OF_RESOURCES;
>    }
> -  NewNotify->NotifyHandleList = (EFI_HANDLE *) AllocateZeroPool (sizeof
> (EFI_HANDLE) *  Private->TextInExListCount);
> +  NewNotify->NotifyHandleList = (VOID **) AllocateZeroPool (sizeof
> + (VOID *) *  Private->TextInExListCount);
>    if (NewNotify->NotifyHandleList == NULL) {
>      gBS->FreePool (NewNotify);
>      return EFI_OUT_OF_RESOURCES;
> diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
> b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
> index 7cfd5c178861..f98797225b63 100644
> --- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
> +++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
> @@ -143,7 +143,7 @@ InternalStartMonitor(
>    EFI_HANDLE                        *Handles;
>    UINTN                             HandleCount;
>    UINTN                             HandleIndex;
> -  EFI_HANDLE                        NotifyHandle;
> +  VOID                              *NotifyHandle;
> 
>    Status = gBS->LocateHandleBuffer (
>                ByProtocol,
> @@ -202,7 +202,7 @@ InternalStopMonitor(
>    EFI_KEY_DATA                      KeyData;
>    UINTN                             HandleCount;
>    UINTN                             HandleIndex;
> -  EFI_HANDLE                        NotifyHandle;
> +  VOID                              *NotifyHandle;
> 
>    Status = gBS->LocateHandleBuffer (
>                  ByProtocol,
> --
> 2.19.1.3.g30247aa5d201
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#47518): https://edk2.groups.io/g/devel/message/47518
Mute This Topic: https://groups.io/mt/34180213/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH 12/35] MdeModulePkg: stop abusing EFI_HANDLE for keystroke notify registration
Posted by Philippe Mathieu-Daudé 6 years, 4 months ago
On 9/17/19 9:49 PM, Laszlo Ersek wrote:
> EFI_REGISTER_KEYSTROKE_NOTIFY and EFI_UNREGISTER_KEYSTROKE_NOTIFY require
> the notification handle to have type (VOID*). The notification handle has
> nothing to do with the EFI_HANDLE type.
> 
> This change is a semantic fix; functionally, it's a no-op.
> 
> Cc: Dandan Bi <dandan.bi@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Zhichao Gao <zhichao.gao@intel.com>
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> ---
> 
> Notes:
>     lightly tested: ConSplitterDxe is part of the ArmVirt and OVMF platforms
> 
>  MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c | 2 +-
>  MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c       | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
> index 63c814ae1816..9c38271b65f9 100644
> --- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
> +++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
> @@ -4026,7 +4026,7 @@ ConSplitterTextInRegisterKeyNotify (
>    if (NewNotify == NULL) {
>      return EFI_OUT_OF_RESOURCES;
>    }
> -  NewNotify->NotifyHandleList = (EFI_HANDLE *) AllocateZeroPool (sizeof (EFI_HANDLE) *  Private->TextInExListCount);
> +  NewNotify->NotifyHandleList = (VOID **) AllocateZeroPool (sizeof (VOID *) *  Private->TextInExListCount);

TEXT_IN_EX_SPLITTER_NOTIFY->NotifyHandleList is of type (VOID **), OK.

>    if (NewNotify->NotifyHandleList == NULL) {
>      gBS->FreePool (NewNotify);
>      return EFI_OUT_OF_RESOURCES;
> diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
> index 7cfd5c178861..f98797225b63 100644
> --- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
> +++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
> @@ -143,7 +143,7 @@ InternalStartMonitor(
>    EFI_HANDLE                        *Handles;
>    UINTN                             HandleCount;
>    UINTN                             HandleIndex;
> -  EFI_HANDLE                        NotifyHandle;
> +  VOID                              *NotifyHandle;
>  
>    Status = gBS->LocateHandleBuffer (
>                ByProtocol,
> @@ -202,7 +202,7 @@ InternalStopMonitor(
>    EFI_KEY_DATA                      KeyData;
>    UINTN                             HandleCount;
>    UINTN                             HandleIndex;
> -  EFI_HANDLE                        NotifyHandle;
> +  VOID                              *NotifyHandle;
>  
>    Status = gBS->LocateHandleBuffer (
>                  ByProtocol,
> 

Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#47921): https://edk2.groups.io/g/devel/message/47921
Mute This Topic: https://groups.io/mt/34180213/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-