diff mbox series

[edk2,edk2-staging,08/19] IntelUndiPkg/GigUndiDxe: add missing VOID** cast

Message ID 20181106175833.26964-9-ard.biesheuvel@linaro.org
State Superseded
Headers show
Series IntelUndiPkg/GigUndiDxe: build fixes for AARCH64/ARM/GCC | expand

Commit Message

Ard Biesheuvel Nov. 6, 2018, 5:58 p.m. UTC
Unlike Visual Studio, GCC does not permit implicit conversion between
a pointer-to-void-pointer and pointer to a typed pointer. So add the
explicit casts where necessary.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

---
 IntelUndiPkg/GigUndiDxe/Hii.c  | 8 ++++----
 IntelUndiPkg/GigUndiDxe/Init.c | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

-- 
2.19.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Comments

Philippe Mathieu-Daudé Nov. 7, 2018, 9:16 a.m. UTC | #1
On 6/11/18 18:58, Ard Biesheuvel wrote:
> Unlike Visual Studio, GCC does not permit implicit conversion between
> a pointer-to-void-pointer and pointer to a typed pointer. So add the
> explicit casts where necessary.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

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

> ---
>   IntelUndiPkg/GigUndiDxe/Hii.c  | 8 ++++----
>   IntelUndiPkg/GigUndiDxe/Init.c | 2 +-
>   2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/IntelUndiPkg/GigUndiDxe/Hii.c b/IntelUndiPkg/GigUndiDxe/Hii.c
> index 43c184cb03c8..a5d8ae207819 100644
> --- a/IntelUndiPkg/GigUndiDxe/Hii.c
> +++ b/IntelUndiPkg/GigUndiDxe/Hii.c
> @@ -459,7 +459,7 @@ HiiOpenProtocol (
>     Status = gBS->LocateProtocol (
>                     &gEfiHiiDatabaseProtocolGuid,
>                     NULL,
> -                  &UndiPrivateData->HiiDatabase
> +                  (VOID **)&UndiPrivateData->HiiDatabase
>                   );
>     if (EFI_ERROR (Status)) {
>       DEBUGPRINT (CRITICAL, ("Error finding HII protocol: %r\n", Status));
> @@ -472,7 +472,7 @@ HiiOpenProtocol (
>     Status = gBS->LocateProtocol (
>                     &gEfiHiiStringProtocolGuid,
>                     NULL,
> -                  &UndiPrivateData->HiiString
> +                  (VOID **)&UndiPrivateData->HiiString
>                   );
>     if (EFI_ERROR (Status)) {
>       DEBUGPRINT (CRITICAL, ("Error finding HII String protocol: %r\n", Status));
> @@ -485,7 +485,7 @@ HiiOpenProtocol (
>     Status = gBS->LocateProtocol (
>                     &gEfiFormBrowser2ProtocolGuid,
>                     NULL,
> -                  &UndiPrivateData->FormBrowser2
> +                  (VOID **)&UndiPrivateData->FormBrowser2
>                   );
>     if (EFI_ERROR (Status)) {
>       DEBUGPRINT (CRITICAL, ("Error finding HII form browser protocol: %r\n", Status));
> @@ -498,7 +498,7 @@ HiiOpenProtocol (
>     Status = gBS->LocateProtocol (
>                     &gEfiHiiConfigRoutingProtocolGuid,
>                     NULL,
> -                  &UndiPrivateData->HiiConfigRouting
> +                  (VOID **)&UndiPrivateData->HiiConfigRouting
>                   );
>     if (EFI_ERROR (Status)) {
>       DEBUGPRINT (CRITICAL, ("Error finding HII ConfigRouting protocol: %r\n", Status));
> diff --git a/IntelUndiPkg/GigUndiDxe/Init.c b/IntelUndiPkg/GigUndiDxe/Init.c
> index f99734d72823..1de424c26fe2 100644
> --- a/IntelUndiPkg/GigUndiDxe/Init.c
> +++ b/IntelUndiPkg/GigUndiDxe/Init.c
> @@ -177,7 +177,7 @@ GigAppendMac2DevPath (
>     Status = gBS->AllocatePool (
>                     EfiBootServicesData, // EfiRuntimeServicesData,
>                     TotalPathLen,
> -                  &DevicePtr
> +                  (VOID **)&DevicePtr
>                   );
>   
>     if (Status != EFI_SUCCESS) {
>
Philippe Mathieu-Daudé Nov. 7, 2018, 2:05 p.m. UTC | #2
On 6/11/18 18:58, Ard Biesheuvel wrote:
> Unlike Visual Studio, GCC does not permit implicit conversion between
> a pointer-to-void-pointer and pointer to a typed pointer. So add the
> explicit casts where necessary.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

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

> ---
>   IntelUndiPkg/GigUndiDxe/Hii.c  | 8 ++++----
>   IntelUndiPkg/GigUndiDxe/Init.c | 2 +-
>   2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/IntelUndiPkg/GigUndiDxe/Hii.c b/IntelUndiPkg/GigUndiDxe/Hii.c
> index 43c184cb03c8..a5d8ae207819 100644
> --- a/IntelUndiPkg/GigUndiDxe/Hii.c
> +++ b/IntelUndiPkg/GigUndiDxe/Hii.c
> @@ -459,7 +459,7 @@ HiiOpenProtocol (
>     Status = gBS->LocateProtocol (
>                     &gEfiHiiDatabaseProtocolGuid,
>                     NULL,
> -                  &UndiPrivateData->HiiDatabase
> +                  (VOID **)&UndiPrivateData->HiiDatabase
>                   );
>     if (EFI_ERROR (Status)) {
>       DEBUGPRINT (CRITICAL, ("Error finding HII protocol: %r\n", Status));
> @@ -472,7 +472,7 @@ HiiOpenProtocol (
>     Status = gBS->LocateProtocol (
>                     &gEfiHiiStringProtocolGuid,
>                     NULL,
> -                  &UndiPrivateData->HiiString
> +                  (VOID **)&UndiPrivateData->HiiString
>                   );
>     if (EFI_ERROR (Status)) {
>       DEBUGPRINT (CRITICAL, ("Error finding HII String protocol: %r\n", Status));
> @@ -485,7 +485,7 @@ HiiOpenProtocol (
>     Status = gBS->LocateProtocol (
>                     &gEfiFormBrowser2ProtocolGuid,
>                     NULL,
> -                  &UndiPrivateData->FormBrowser2
> +                  (VOID **)&UndiPrivateData->FormBrowser2
>                   );
>     if (EFI_ERROR (Status)) {
>       DEBUGPRINT (CRITICAL, ("Error finding HII form browser protocol: %r\n", Status));
> @@ -498,7 +498,7 @@ HiiOpenProtocol (
>     Status = gBS->LocateProtocol (
>                     &gEfiHiiConfigRoutingProtocolGuid,
>                     NULL,
> -                  &UndiPrivateData->HiiConfigRouting
> +                  (VOID **)&UndiPrivateData->HiiConfigRouting
>                   );
>     if (EFI_ERROR (Status)) {
>       DEBUGPRINT (CRITICAL, ("Error finding HII ConfigRouting protocol: %r\n", Status));
> diff --git a/IntelUndiPkg/GigUndiDxe/Init.c b/IntelUndiPkg/GigUndiDxe/Init.c
> index f99734d72823..1de424c26fe2 100644
> --- a/IntelUndiPkg/GigUndiDxe/Init.c
> +++ b/IntelUndiPkg/GigUndiDxe/Init.c
> @@ -177,7 +177,7 @@ GigAppendMac2DevPath (
>     Status = gBS->AllocatePool (
>                     EfiBootServicesData, // EfiRuntimeServicesData,
>                     TotalPathLen,
> -                  &DevicePtr
> +                  (VOID **)&DevicePtr
>                   );
>   
>     if (Status != EFI_SUCCESS) {
>
Ryszard Knop Jan. 30, 2019, 12:05 p.m. UTC | #3
Reviewed-by: Ryszard Knop <ryszard.knop@linux.intel.com>


On Tue, 2018-11-06 at 18:58 +0100, ard.biesheuvela wrote:
> Unlike Visual Studio, GCC does not permit implicit conversion between

> a pointer-to-void-pointer and pointer to a typed pointer. So add the

> explicit casts where necessary.

> 

> Contributed-under: TianoCore Contribution Agreement 1.1

> Signed-off-by: Ard Biesheuvel <ard.biesheuvel at linaro.org>

> ---

>  IntelUndiPkg/GigUndiDxe/Hii.c  | 8 ++++----

>  IntelUndiPkg/GigUndiDxe/Init.c | 2 +-

>  2 files changed, 5 insertions(+), 5 deletions(-)

> 

> diff --git a/IntelUndiPkg/GigUndiDxe/Hii.c

> b/IntelUndiPkg/GigUndiDxe/Hii.c

> index 43c184cb03c8..a5d8ae207819 100644

> --- a/IntelUndiPkg/GigUndiDxe/Hii.c

> +++ b/IntelUndiPkg/GigUndiDxe/Hii.c

> @@ -459,7 +459,7 @@ HiiOpenProtocol (

>    Status = gBS->LocateProtocol (

>                    &gEfiHiiDatabaseProtocolGuid,

>                    NULL,

> -                  &UndiPrivateData->HiiDatabase

> +                  (VOID **)&UndiPrivateData->HiiDatabase

>                  );

>    if (EFI_ERROR (Status)) {

>      DEBUGPRINT (CRITICAL, ("Error finding HII protocol: %r\n",

> Status));

> @@ -472,7 +472,7 @@ HiiOpenProtocol (

>    Status = gBS->LocateProtocol (

>                    &gEfiHiiStringProtocolGuid,

>                    NULL,

> -                  &UndiPrivateData->HiiString

> +                  (VOID **)&UndiPrivateData->HiiString

>                  );

>    if (EFI_ERROR (Status)) {

>      DEBUGPRINT (CRITICAL, ("Error finding HII String protocol:

> %r\n", Status));

> @@ -485,7 +485,7 @@ HiiOpenProtocol (

>    Status = gBS->LocateProtocol (

>                    &gEfiFormBrowser2ProtocolGuid,

>                    NULL,

> -                  &UndiPrivateData->FormBrowser2

> +                  (VOID **)&UndiPrivateData->FormBrowser2

>                  );

>    if (EFI_ERROR (Status)) {

>      DEBUGPRINT (CRITICAL, ("Error finding HII form browser protocol:

> %r\n", Status));

> @@ -498,7 +498,7 @@ HiiOpenProtocol (

>    Status = gBS->LocateProtocol (

>                    &gEfiHiiConfigRoutingProtocolGuid,

>                    NULL,

> -                  &UndiPrivateData->HiiConfigRouting

> +                  (VOID **)&UndiPrivateData->HiiConfigRouting

>                  );

>    if (EFI_ERROR (Status)) {

>      DEBUGPRINT (CRITICAL, ("Error finding HII ConfigRouting

> protocol: %r\n", Status));

> diff --git a/IntelUndiPkg/GigUndiDxe/Init.c

> b/IntelUndiPkg/GigUndiDxe/Init.c

> index f99734d72823..1de424c26fe2 100644

> --- a/IntelUndiPkg/GigUndiDxe/Init.c

> +++ b/IntelUndiPkg/GigUndiDxe/Init.c

> @@ -177,7 +177,7 @@ GigAppendMac2DevPath (

>    Status = gBS->AllocatePool (

>                    EfiBootServicesData, // EfiRuntimeServicesData,

>                    TotalPathLen,

> -                  &DevicePtr

> +                  (VOID **)&DevicePtr

>                  );

>  

>    if (Status != EFI_SUCCESS) {


_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
diff mbox series

Patch

diff --git a/IntelUndiPkg/GigUndiDxe/Hii.c b/IntelUndiPkg/GigUndiDxe/Hii.c
index 43c184cb03c8..a5d8ae207819 100644
--- a/IntelUndiPkg/GigUndiDxe/Hii.c
+++ b/IntelUndiPkg/GigUndiDxe/Hii.c
@@ -459,7 +459,7 @@  HiiOpenProtocol (
   Status = gBS->LocateProtocol (
                   &gEfiHiiDatabaseProtocolGuid,
                   NULL,
-                  &UndiPrivateData->HiiDatabase
+                  (VOID **)&UndiPrivateData->HiiDatabase
                 );
   if (EFI_ERROR (Status)) {
     DEBUGPRINT (CRITICAL, ("Error finding HII protocol: %r\n", Status));
@@ -472,7 +472,7 @@  HiiOpenProtocol (
   Status = gBS->LocateProtocol (
                   &gEfiHiiStringProtocolGuid,
                   NULL,
-                  &UndiPrivateData->HiiString
+                  (VOID **)&UndiPrivateData->HiiString
                 );
   if (EFI_ERROR (Status)) {
     DEBUGPRINT (CRITICAL, ("Error finding HII String protocol: %r\n", Status));
@@ -485,7 +485,7 @@  HiiOpenProtocol (
   Status = gBS->LocateProtocol (
                   &gEfiFormBrowser2ProtocolGuid,
                   NULL,
-                  &UndiPrivateData->FormBrowser2
+                  (VOID **)&UndiPrivateData->FormBrowser2
                 );
   if (EFI_ERROR (Status)) {
     DEBUGPRINT (CRITICAL, ("Error finding HII form browser protocol: %r\n", Status));
@@ -498,7 +498,7 @@  HiiOpenProtocol (
   Status = gBS->LocateProtocol (
                   &gEfiHiiConfigRoutingProtocolGuid,
                   NULL,
-                  &UndiPrivateData->HiiConfigRouting
+                  (VOID **)&UndiPrivateData->HiiConfigRouting
                 );
   if (EFI_ERROR (Status)) {
     DEBUGPRINT (CRITICAL, ("Error finding HII ConfigRouting protocol: %r\n", Status));
diff --git a/IntelUndiPkg/GigUndiDxe/Init.c b/IntelUndiPkg/GigUndiDxe/Init.c
index f99734d72823..1de424c26fe2 100644
--- a/IntelUndiPkg/GigUndiDxe/Init.c
+++ b/IntelUndiPkg/GigUndiDxe/Init.c
@@ -177,7 +177,7 @@  GigAppendMac2DevPath (
   Status = gBS->AllocatePool (
                   EfiBootServicesData, // EfiRuntimeServicesData,
                   TotalPathLen,
-                  &DevicePtr
+                  (VOID **)&DevicePtr
                 );
 
   if (Status != EFI_SUCCESS) {