diff mbox

[edk2,1/6] MdePkg/UefiLib: move InternalEmptyFunction to UefiLib.c

Message ID 1458667268-23242-2-git-send-email-lersek@redhat.com
State New
Headers show

Commit Message

Laszlo Ersek March 22, 2016, 5:21 p.m. UTC
The InternalEmptyFunction() is currently only used by code in
"UefiNotTiano.c" -- "Library functions that abstract areas of conflict
between framework and UEFI 2.0.". In the next patches,
InternalEmptyFunction() will be used from "UefiLib.c" as well, hence
promote it to "general utility" status: move the function definition to
"UefiLib.c", and place the function declaration (which is already extern)
into "UefiLibInternal.h".

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>

---
 MdePkg/Library/UefiLib/UefiLibInternal.h | 18 +++++++++++++++++
 MdePkg/Library/UefiLib/UefiLib.c         | 19 ++++++++++++++++++
 MdePkg/Library/UefiLib/UefiNotTiano.c    | 21 --------------------
 3 files changed, 37 insertions(+), 21 deletions(-)

-- 
1.8.3.1


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

Comments

Laszlo Ersek March 22, 2016, 6:14 p.m. UTC | #1
On 03/22/16 19:08, Jordan Justen wrote:
> On 2016-03-22 10:21:03, Laszlo Ersek wrote:

>> The InternalEmptyFunction() is currently only used by code in

> 

> How about a rename to EfiEmptyEventCallbackFunction?


The Efi prefix suggests this function would be exported to consumers of
the library. Internal functions (of all library instances in edk2, as
far as I am aware) have the prefix Internal, even if they have external
linkage (so they can be shared between the .c files of the library
instance).

How about InternalEmptyEventCallbackFunction?

Thanks
Laszlo

> 

> With that, Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

> 

>> "UefiNotTiano.c" -- "Library functions that abstract areas of conflict

>> between framework and UEFI 2.0.". In the next patches,

>> InternalEmptyFunction() will be used from "UefiLib.c" as well, hence

>> promote it to "general utility" status: move the function definition to

>> "UefiLib.c", and place the function declaration (which is already extern)

>> into "UefiLibInternal.h".

>>

>> Cc: Michael D Kinney <michael.d.kinney@intel.com>

>> Cc: Liming Gao <liming.gao@intel.com>

>> Cc: Jordan Justen <jordan.l.justen@intel.com>

>> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>

>> Contributed-under: TianoCore Contribution Agreement 1.0

>> Signed-off-by: Laszlo Ersek <lersek@redhat.com>

>> ---

>>  MdePkg/Library/UefiLib/UefiLibInternal.h | 18 +++++++++++++++++

>>  MdePkg/Library/UefiLib/UefiLib.c         | 19 ++++++++++++++++++

>>  MdePkg/Library/UefiLib/UefiNotTiano.c    | 21 --------------------

>>  3 files changed, 37 insertions(+), 21 deletions(-)

>>

>> diff --git a/MdePkg/Library/UefiLib/UefiLibInternal.h b/MdePkg/Library/UefiLib/UefiLibInternal.h

>> index 196830e10cb6..2311f27f1e6d 100644

>> --- a/MdePkg/Library/UefiLib/UefiLibInternal.h

>> +++ b/MdePkg/Library/UefiLib/UefiLibInternal.h

>> @@ -41,4 +41,22 @@

>>  #include <Library/PrintLib.h>

>>  #include <Library/DevicePathLib.h>

>>  

>> +/**

>> +  An empty function to pass error checking of CreateEventEx ().

>> +

>> +  This empty function ensures that EVT_NOTIFY_SIGNAL_ALL is error

>> +  checked correctly since it is now mapped into CreateEventEx() in UEFI 2.0.

>> +

>> +  @param  Event                 Event whose notification function is being invoked.

>> +  @param  Context               The pointer to the notification function's context,

>> +                                which is implementation-dependent.

>> +

>> +**/

>> +VOID

>> +EFIAPI

>> +InternalEmptyFunction (

>> +  IN EFI_EVENT                Event,

>> +  IN VOID                     *Context

>> +  );

>> +

>>  #endif

>> diff --git a/MdePkg/Library/UefiLib/UefiLib.c b/MdePkg/Library/UefiLib/UefiLib.c

>> index 112766ad8634..ba3acc1af228 100644

>> --- a/MdePkg/Library/UefiLib/UefiLib.c

>> +++ b/MdePkg/Library/UefiLib/UefiLib.c

>> @@ -1545,3 +1545,22 @@ GetBestLanguage (

>>    return NULL;

>>  }

>>  

>> +/**

>> +  An empty function to pass error checking of CreateEventEx ().

>> +

>> +  This empty function ensures that EVT_NOTIFY_SIGNAL_ALL is error

>> +  checked correctly since it is now mapped into CreateEventEx() in UEFI 2.0.

>> +

>> +  @param  Event                 Event whose notification function is being invoked.

>> +  @param  Context               The pointer to the notification function's context,

>> +                                which is implementation-dependent.

>> +

>> +**/

>> +VOID

>> +EFIAPI

>> +InternalEmptyFunction (

>> +  IN EFI_EVENT                Event,

>> +  IN VOID                     *Context

>> +  )

>> +{

>> +}

>> diff --git a/MdePkg/Library/UefiLib/UefiNotTiano.c b/MdePkg/Library/UefiLib/UefiNotTiano.c

>> index 9b95be65fd48..46fa737c0fd3 100644

>> --- a/MdePkg/Library/UefiLib/UefiNotTiano.c

>> +++ b/MdePkg/Library/UefiLib/UefiNotTiano.c

>> @@ -22,27 +22,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

>>  #include "UefiLibInternal.h"

>>  

>>  /**

>> -  An empty function to pass error checking of CreateEventEx ().

>> -

>> -  This empty function ensures that EVT_NOTIFY_SIGNAL_ALL is error

>> -  checked correctly since it is now mapped into CreateEventEx() in UEFI 2.0.

>> - 

>> -  @param  Event                 Event whose notification function is being invoked.

>> -  @param  Context               The pointer to the notification function's context,

>> -                                which is implementation-dependent.

>> -

>> -**/

>> -VOID

>> -EFIAPI

>> -InternalEmptyFunction (

>> -  IN EFI_EVENT                Event,

>> -  IN VOID                     *Context

>> -  )

>> -{

>> -  return;

>> -}

>> -

>> -/**

>>    Creates an EFI event in the Legacy Boot Event Group.

>>  

>>    Prior to UEFI 2.0 this was done via a non blessed UEFI extensions and this library

>> -- 

>> 1.8.3.1

>>

>>

> _______________________________________________

> edk2-devel mailing list

> edk2-devel@lists.01.org

> https://lists.01.org/mailman/listinfo/edk2-devel

> 


_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Laszlo Ersek March 22, 2016, 7:03 p.m. UTC | #2
On 03/22/16 19:59, Jordan Justen wrote:
> On 2016-03-22 11:14:53, Laszlo Ersek wrote:

>> On 03/22/16 19:08, Jordan Justen wrote:

>>> On 2016-03-22 10:21:03, Laszlo Ersek wrote:

>>>> The InternalEmptyFunction() is currently only used by code in

>>>

>>> How about a rename to EfiEmptyEventCallbackFunction?

>>

>> The Efi prefix suggests this function would be exported to consumers of

>> the library. Internal functions (of all library instances in edk2, as

>> far as I am aware) have the prefix Internal, even if they have external

>> linkage (so they can be shared between the .c files of the library

>> instance).

>>

>> How about InternalEmptyEventCallbackFunction?

>>

> 

> Bah. For some reason I thought you were proposing that the function

> become externally visible in the library interface. In other words, a

> no-op function that consumers could use when signalling. I read the

> other patches, so nevermind on that rename comment...

> 

> Series Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>


Thank you!

I'll await Mike's feedback on the MdePkg & IntelFrameworkPkg patches.
(Liming's and Jeff's feedback is equivalently appreciated of course, but
it's early dawn in their timezone I think.)

Thanks!
Laszlo

> 

>>

>>>

>>> With that, Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

>>>

>>>> "UefiNotTiano.c" -- "Library functions that abstract areas of conflict

>>>> between framework and UEFI 2.0.". In the next patches,

>>>> InternalEmptyFunction() will be used from "UefiLib.c" as well, hence

>>>> promote it to "general utility" status: move the function definition to

>>>> "UefiLib.c", and place the function declaration (which is already extern)

>>>> into "UefiLibInternal.h".

>>>>

>>>> Cc: Michael D Kinney <michael.d.kinney@intel.com>

>>>> Cc: Liming Gao <liming.gao@intel.com>

>>>> Cc: Jordan Justen <jordan.l.justen@intel.com>

>>>> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>

>>>> Contributed-under: TianoCore Contribution Agreement 1.0

>>>> Signed-off-by: Laszlo Ersek <lersek@redhat.com>

>>>> ---

>>>>  MdePkg/Library/UefiLib/UefiLibInternal.h | 18 +++++++++++++++++

>>>>  MdePkg/Library/UefiLib/UefiLib.c         | 19 ++++++++++++++++++

>>>>  MdePkg/Library/UefiLib/UefiNotTiano.c    | 21 --------------------

>>>>  3 files changed, 37 insertions(+), 21 deletions(-)

>>>>

>>>> diff --git a/MdePkg/Library/UefiLib/UefiLibInternal.h b/MdePkg/Library/UefiLib/UefiLibInternal.h

>>>> index 196830e10cb6..2311f27f1e6d 100644

>>>> --- a/MdePkg/Library/UefiLib/UefiLibInternal.h

>>>> +++ b/MdePkg/Library/UefiLib/UefiLibInternal.h

>>>> @@ -41,4 +41,22 @@

>>>>  #include <Library/PrintLib.h>

>>>>  #include <Library/DevicePathLib.h>

>>>>  

>>>> +/**

>>>> +  An empty function to pass error checking of CreateEventEx ().

>>>> +

>>>> +  This empty function ensures that EVT_NOTIFY_SIGNAL_ALL is error

>>>> +  checked correctly since it is now mapped into CreateEventEx() in UEFI 2.0.

>>>> +

>>>> +  @param  Event                 Event whose notification function is being invoked.

>>>> +  @param  Context               The pointer to the notification function's context,

>>>> +                                which is implementation-dependent.

>>>> +

>>>> +**/

>>>> +VOID

>>>> +EFIAPI

>>>> +InternalEmptyFunction (

>>>> +  IN EFI_EVENT                Event,

>>>> +  IN VOID                     *Context

>>>> +  );

>>>> +

>>>>  #endif

>>>> diff --git a/MdePkg/Library/UefiLib/UefiLib.c b/MdePkg/Library/UefiLib/UefiLib.c

>>>> index 112766ad8634..ba3acc1af228 100644

>>>> --- a/MdePkg/Library/UefiLib/UefiLib.c

>>>> +++ b/MdePkg/Library/UefiLib/UefiLib.c

>>>> @@ -1545,3 +1545,22 @@ GetBestLanguage (

>>>>    return NULL;

>>>>  }

>>>>  

>>>> +/**

>>>> +  An empty function to pass error checking of CreateEventEx ().

>>>> +

>>>> +  This empty function ensures that EVT_NOTIFY_SIGNAL_ALL is error

>>>> +  checked correctly since it is now mapped into CreateEventEx() in UEFI 2.0.

>>>> +

>>>> +  @param  Event                 Event whose notification function is being invoked.

>>>> +  @param  Context               The pointer to the notification function's context,

>>>> +                                which is implementation-dependent.

>>>> +

>>>> +**/

>>>> +VOID

>>>> +EFIAPI

>>>> +InternalEmptyFunction (

>>>> +  IN EFI_EVENT                Event,

>>>> +  IN VOID                     *Context

>>>> +  )

>>>> +{

>>>> +}

>>>> diff --git a/MdePkg/Library/UefiLib/UefiNotTiano.c b/MdePkg/Library/UefiLib/UefiNotTiano.c

>>>> index 9b95be65fd48..46fa737c0fd3 100644

>>>> --- a/MdePkg/Library/UefiLib/UefiNotTiano.c

>>>> +++ b/MdePkg/Library/UefiLib/UefiNotTiano.c

>>>> @@ -22,27 +22,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

>>>>  #include "UefiLibInternal.h"

>>>>  

>>>>  /**

>>>> -  An empty function to pass error checking of CreateEventEx ().

>>>> -

>>>> -  This empty function ensures that EVT_NOTIFY_SIGNAL_ALL is error

>>>> -  checked correctly since it is now mapped into CreateEventEx() in UEFI 2.0.

>>>> - 

>>>> -  @param  Event                 Event whose notification function is being invoked.

>>>> -  @param  Context               The pointer to the notification function's context,

>>>> -                                which is implementation-dependent.

>>>> -

>>>> -**/

>>>> -VOID

>>>> -EFIAPI

>>>> -InternalEmptyFunction (

>>>> -  IN EFI_EVENT                Event,

>>>> -  IN VOID                     *Context

>>>> -  )

>>>> -{

>>>> -  return;

>>>> -}

>>>> -

>>>> -/**

>>>>    Creates an EFI event in the Legacy Boot Event Group.

>>>>  

>>>>    Prior to UEFI 2.0 this was done via a non blessed UEFI extensions and this library

>>>> -- 

>>>> 1.8.3.1

>>>>

>>>>

>>> _______________________________________________

>>> edk2-devel mailing list

>>> edk2-devel@lists.01.org

>>> https://lists.01.org/mailman/listinfo/edk2-devel

>>>

>>


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

Patch

diff --git a/MdePkg/Library/UefiLib/UefiLibInternal.h b/MdePkg/Library/UefiLib/UefiLibInternal.h
index 196830e10cb6..2311f27f1e6d 100644
--- a/MdePkg/Library/UefiLib/UefiLibInternal.h
+++ b/MdePkg/Library/UefiLib/UefiLibInternal.h
@@ -41,4 +41,22 @@ 
 #include <Library/PrintLib.h>
 #include <Library/DevicePathLib.h>
 
+/**
+  An empty function to pass error checking of CreateEventEx ().
+
+  This empty function ensures that EVT_NOTIFY_SIGNAL_ALL is error
+  checked correctly since it is now mapped into CreateEventEx() in UEFI 2.0.
+
+  @param  Event                 Event whose notification function is being invoked.
+  @param  Context               The pointer to the notification function's context,
+                                which is implementation-dependent.
+
+**/
+VOID
+EFIAPI
+InternalEmptyFunction (
+  IN EFI_EVENT                Event,
+  IN VOID                     *Context
+  );
+
 #endif
diff --git a/MdePkg/Library/UefiLib/UefiLib.c b/MdePkg/Library/UefiLib/UefiLib.c
index 112766ad8634..ba3acc1af228 100644
--- a/MdePkg/Library/UefiLib/UefiLib.c
+++ b/MdePkg/Library/UefiLib/UefiLib.c
@@ -1545,3 +1545,22 @@  GetBestLanguage (
   return NULL;
 }
 
+/**
+  An empty function to pass error checking of CreateEventEx ().
+
+  This empty function ensures that EVT_NOTIFY_SIGNAL_ALL is error
+  checked correctly since it is now mapped into CreateEventEx() in UEFI 2.0.
+
+  @param  Event                 Event whose notification function is being invoked.
+  @param  Context               The pointer to the notification function's context,
+                                which is implementation-dependent.
+
+**/
+VOID
+EFIAPI
+InternalEmptyFunction (
+  IN EFI_EVENT                Event,
+  IN VOID                     *Context
+  )
+{
+}
diff --git a/MdePkg/Library/UefiLib/UefiNotTiano.c b/MdePkg/Library/UefiLib/UefiNotTiano.c
index 9b95be65fd48..46fa737c0fd3 100644
--- a/MdePkg/Library/UefiLib/UefiNotTiano.c
+++ b/MdePkg/Library/UefiLib/UefiNotTiano.c
@@ -22,27 +22,6 @@  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include "UefiLibInternal.h"
 
 /**
-  An empty function to pass error checking of CreateEventEx ().
-
-  This empty function ensures that EVT_NOTIFY_SIGNAL_ALL is error
-  checked correctly since it is now mapped into CreateEventEx() in UEFI 2.0.
- 
-  @param  Event                 Event whose notification function is being invoked.
-  @param  Context               The pointer to the notification function's context,
-                                which is implementation-dependent.
-
-**/
-VOID
-EFIAPI
-InternalEmptyFunction (
-  IN EFI_EVENT                Event,
-  IN VOID                     *Context
-  )
-{
-  return;
-}
-
-/**
   Creates an EFI event in the Legacy Boot Event Group.
 
   Prior to UEFI 2.0 this was done via a non blessed UEFI extensions and this library