public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [PATCH v2 1/1] MdePkg/BaseFdtLib: Rename standard functions
@ 2024-01-23 23:15 Jeff Brasen via groups.io
  2024-01-23 23:26 ` Michael D Kinney
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Brasen via groups.io @ 2024-01-23 23:15 UTC (permalink / raw)
  To: devel; +Cc: gaoliming, michael.d.kinney, zhiguang.liu, Jeff Brasen

Rename the standard functions in the LibFdtSupport to remove conflicts
with other libraries that define them.

Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
---
 MdePkg/Library/BaseFdtLib/LibFdtSupport.h |  7 +++++--
 MdePkg/Library/BaseFdtLib/LibFdtWrapper.c | 25 ++---------------------
 2 files changed, 7 insertions(+), 25 deletions(-)

diff --git a/MdePkg/Library/BaseFdtLib/LibFdtSupport.h b/MdePkg/Library/BaseFdtLib/LibFdtSupport.h
index 393019324b73..8a26fbfc3251 100644
--- a/MdePkg/Library/BaseFdtLib/LibFdtSupport.h
+++ b/MdePkg/Library/BaseFdtLib/LibFdtSupport.h
@@ -63,13 +63,13 @@ strchr     (
   );
 
 char *
-strrchr    (
+fdt_strrchr    (
   const char *,
   int
   );
 
 unsigned long
-strtoul     (
+fdt_strtoul     (
   const char *,
   char **,
   int
@@ -93,7 +93,10 @@ strcpy (
 #define strnlen(str, count)                 (size_t)(AsciiStrnLenS(str, count))
 #define strncpy(strDest, strSource, count)  AsciiStrnCpyS(strDest, MAX_STRING_SIZE, strSource, (UINTN)count)
 #define strcat(strDest, strSource)          AsciiStrCatS(strDest, MAX_STRING_SIZE, strSource)
+#define strchr(str, ch)                     ScanMem8(str, AsciiStrSize (str), (UINT8)ch)
 #define strcmp(string1, string2, count)     (int)(AsciiStrCmp(string1, string2))
 #define strncmp(string1, string2, count)    (int)(AsciiStrnCmp(string1, string2, (UINTN)(count)))
+#define strrchr(str, ch)                    fdt_strrchr(str, ch)
+#define strtoul(ptr, end_ptr, base)         fdt_strtoul(ptr, end_ptr, base)
 
 #endif /* FDT_LIB_SUPPORT_H_ */
diff --git a/MdePkg/Library/BaseFdtLib/LibFdtWrapper.c b/MdePkg/Library/BaseFdtLib/LibFdtWrapper.c
index ef6452914f5b..1a4cd573fdaf 100644
--- a/MdePkg/Library/BaseFdtLib/LibFdtWrapper.c
+++ b/MdePkg/Library/BaseFdtLib/LibFdtWrapper.c
@@ -18,28 +18,7 @@
 // so the code gets a bit clunky to handle that case specifically.
 
 char *
-strchr (
-  const char  *Str,
-  int         Char
-  )
-{
-  char  *S;
-
-  S = (char *)Str;
-
-  for ( ; ; S++) {
-    if (*S == Char) {
-      return S;
-    }
-
-    if (*S == '\0') {
-      return NULL;
-    }
-  }
-}
-
-char *
-strrchr (
+fdt_strrchr (
   const char  *Str,
   int         Char
   )
@@ -71,7 +50,7 @@ __isspace (
 }
 
 unsigned long
-strtoul (
+fdt_strtoul (
   const char  *Nptr,
   char        **EndPtr,
   int         Base
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114240): https://edk2.groups.io/g/devel/message/114240
Mute This Topic: https://groups.io/mt/103921658/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [edk2-devel] [PATCH v2 1/1] MdePkg/BaseFdtLib: Rename standard functions
  2024-01-23 23:15 [edk2-devel] [PATCH v2 1/1] MdePkg/BaseFdtLib: Rename standard functions Jeff Brasen via groups.io
@ 2024-01-23 23:26 ` Michael D Kinney
  2024-01-24  6:27   ` Michael D Kinney
  0 siblings, 1 reply; 3+ messages in thread
From: Michael D Kinney @ 2024-01-23 23:26 UTC (permalink / raw)
  To: devel@edk2.groups.io, jbrasen@nvidia.com
  Cc: gaoliming@byosoft.com.cn, Liu, Zhiguang, Kinney, Michael D

Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>


> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Jeff
> Brasen via groups.io
> Sent: Tuesday, January 23, 2024 3:16 PM
> To: devel@edk2.groups.io
> Cc: gaoliming@byosoft.com.cn; Kinney, Michael D
> <michael.d.kinney@intel.com>; Liu, Zhiguang <zhiguang.liu@intel.com>;
> Jeff Brasen <jbrasen@nvidia.com>
> Subject: [edk2-devel] [PATCH v2 1/1] MdePkg/BaseFdtLib: Rename standard
> functions
> 
> Rename the standard functions in the LibFdtSupport to remove conflicts
> with other libraries that define them.
> 
> Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
> ---
>  MdePkg/Library/BaseFdtLib/LibFdtSupport.h |  7 +++++--
>  MdePkg/Library/BaseFdtLib/LibFdtWrapper.c | 25 ++---------------------
>  2 files changed, 7 insertions(+), 25 deletions(-)
> 
> diff --git a/MdePkg/Library/BaseFdtLib/LibFdtSupport.h
> b/MdePkg/Library/BaseFdtLib/LibFdtSupport.h
> index 393019324b73..8a26fbfc3251 100644
> --- a/MdePkg/Library/BaseFdtLib/LibFdtSupport.h
> +++ b/MdePkg/Library/BaseFdtLib/LibFdtSupport.h
> @@ -63,13 +63,13 @@ strchr     (
>    );
> 
>  char *
> -strrchr    (
> +fdt_strrchr    (
>    const char *,
>    int
>    );
> 
>  unsigned long
> -strtoul     (
> +fdt_strtoul     (
>    const char *,
>    char **,
>    int
> @@ -93,7 +93,10 @@ strcpy (
>  #define strnlen(str, count)                 (size_t)(AsciiStrnLenS(str,
> count))
>  #define strncpy(strDest, strSource, count)  AsciiStrnCpyS(strDest,
> MAX_STRING_SIZE, strSource, (UINTN)count)
>  #define strcat(strDest, strSource)          AsciiStrCatS(strDest,
> MAX_STRING_SIZE, strSource)
> +#define strchr(str, ch)                     ScanMem8(str, AsciiStrSize
> (str), (UINT8)ch)
>  #define strcmp(string1, string2, count)     (int)(AsciiStrCmp(string1,
> string2))
>  #define strncmp(string1, string2, count)    (int)(AsciiStrnCmp(string1,
> string2, (UINTN)(count)))
> +#define strrchr(str, ch)                    fdt_strrchr(str, ch)
> +#define strtoul(ptr, end_ptr, base)         fdt_strtoul(ptr, end_ptr,
> base)
> 
>  #endif /* FDT_LIB_SUPPORT_H_ */
> diff --git a/MdePkg/Library/BaseFdtLib/LibFdtWrapper.c
> b/MdePkg/Library/BaseFdtLib/LibFdtWrapper.c
> index ef6452914f5b..1a4cd573fdaf 100644
> --- a/MdePkg/Library/BaseFdtLib/LibFdtWrapper.c
> +++ b/MdePkg/Library/BaseFdtLib/LibFdtWrapper.c
> @@ -18,28 +18,7 @@
>  // so the code gets a bit clunky to handle that case specifically.
> 
>  char *
> -strchr (
> -  const char  *Str,
> -  int         Char
> -  )
> -{
> -  char  *S;
> -
> -  S = (char *)Str;
> -
> -  for ( ; ; S++) {
> -    if (*S == Char) {
> -      return S;
> -    }
> -
> -    if (*S == '\0') {
> -      return NULL;
> -    }
> -  }
> -}
> -
> -char *
> -strrchr (
> +fdt_strrchr (
>    const char  *Str,
>    int         Char
>    )
> @@ -71,7 +50,7 @@ __isspace (
>  }
> 
>  unsigned long
> -strtoul (
> +fdt_strtoul (
>    const char  *Nptr,
>    char        **EndPtr,
>    int         Base
> --
> 2.34.1
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114242): https://edk2.groups.io/g/devel/message/114242
Mute This Topic: https://groups.io/mt/103921658/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [edk2-devel] [PATCH v2 1/1] MdePkg/BaseFdtLib: Rename standard functions
  2024-01-23 23:26 ` Michael D Kinney
@ 2024-01-24  6:27   ` Michael D Kinney
  0 siblings, 0 replies; 3+ messages in thread
From: Michael D Kinney @ 2024-01-24  6:27 UTC (permalink / raw)
  To: devel@edk2.groups.io, jbrasen@nvidia.com
  Cc: gaoliming@byosoft.com.cn, Liu, Zhiguang, Kinney, Michael D

Merged: https://github.com/tianocore/edk2/pull/5294

> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Tuesday, January 23, 2024 3:27 PM
> To: devel@edk2.groups.io; jbrasen@nvidia.com
> Cc: gaoliming@byosoft.com.cn; Liu, Zhiguang <zhiguang.liu@intel.com>;
> Kinney, Michael D <michael.d.kinney@intel.com>
> Subject: RE: [edk2-devel] [PATCH v2 1/1] MdePkg/BaseFdtLib: Rename
> standard functions
> 
> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
> 
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Jeff
> > Brasen via groups.io
> > Sent: Tuesday, January 23, 2024 3:16 PM
> > To: devel@edk2.groups.io
> > Cc: gaoliming@byosoft.com.cn; Kinney, Michael D
> > <michael.d.kinney@intel.com>; Liu, Zhiguang <zhiguang.liu@intel.com>;
> > Jeff Brasen <jbrasen@nvidia.com>
> > Subject: [edk2-devel] [PATCH v2 1/1] MdePkg/BaseFdtLib: Rename
> standard
> > functions
> >
> > Rename the standard functions in the LibFdtSupport to remove conflicts
> > with other libraries that define them.
> >
> > Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
> > ---
> >  MdePkg/Library/BaseFdtLib/LibFdtSupport.h |  7 +++++--
> >  MdePkg/Library/BaseFdtLib/LibFdtWrapper.c | 25 ++--------------------
> -
> >  2 files changed, 7 insertions(+), 25 deletions(-)
> >
> > diff --git a/MdePkg/Library/BaseFdtLib/LibFdtSupport.h
> > b/MdePkg/Library/BaseFdtLib/LibFdtSupport.h
> > index 393019324b73..8a26fbfc3251 100644
> > --- a/MdePkg/Library/BaseFdtLib/LibFdtSupport.h
> > +++ b/MdePkg/Library/BaseFdtLib/LibFdtSupport.h
> > @@ -63,13 +63,13 @@ strchr     (
> >    );
> >
> >  char *
> > -strrchr    (
> > +fdt_strrchr    (
> >    const char *,
> >    int
> >    );
> >
> >  unsigned long
> > -strtoul     (
> > +fdt_strtoul     (
> >    const char *,
> >    char **,
> >    int
> > @@ -93,7 +93,10 @@ strcpy (
> >  #define strnlen(str, count)
> (size_t)(AsciiStrnLenS(str,
> > count))
> >  #define strncpy(strDest, strSource, count)  AsciiStrnCpyS(strDest,
> > MAX_STRING_SIZE, strSource, (UINTN)count)
> >  #define strcat(strDest, strSource)          AsciiStrCatS(strDest,
> > MAX_STRING_SIZE, strSource)
> > +#define strchr(str, ch)                     ScanMem8(str,
> AsciiStrSize
> > (str), (UINT8)ch)
> >  #define strcmp(string1, string2, count)
> (int)(AsciiStrCmp(string1,
> > string2))
> >  #define strncmp(string1, string2, count)
> (int)(AsciiStrnCmp(string1,
> > string2, (UINTN)(count)))
> > +#define strrchr(str, ch)                    fdt_strrchr(str, ch)
> > +#define strtoul(ptr, end_ptr, base)         fdt_strtoul(ptr, end_ptr,
> > base)
> >
> >  #endif /* FDT_LIB_SUPPORT_H_ */
> > diff --git a/MdePkg/Library/BaseFdtLib/LibFdtWrapper.c
> > b/MdePkg/Library/BaseFdtLib/LibFdtWrapper.c
> > index ef6452914f5b..1a4cd573fdaf 100644
> > --- a/MdePkg/Library/BaseFdtLib/LibFdtWrapper.c
> > +++ b/MdePkg/Library/BaseFdtLib/LibFdtWrapper.c
> > @@ -18,28 +18,7 @@
> >  // so the code gets a bit clunky to handle that case specifically.
> >
> >  char *
> > -strchr (
> > -  const char  *Str,
> > -  int         Char
> > -  )
> > -{
> > -  char  *S;
> > -
> > -  S = (char *)Str;
> > -
> > -  for ( ; ; S++) {
> > -    if (*S == Char) {
> > -      return S;
> > -    }
> > -
> > -    if (*S == '\0') {
> > -      return NULL;
> > -    }
> > -  }
> > -}
> > -
> > -char *
> > -strrchr (
> > +fdt_strrchr (
> >    const char  *Str,
> >    int         Char
> >    )
> > @@ -71,7 +50,7 @@ __isspace (
> >  }
> >
> >  unsigned long
> > -strtoul (
> > +fdt_strtoul (
> >    const char  *Nptr,
> >    char        **EndPtr,
> >    int         Base
> > --
> > 2.34.1
> >
> >
> >
> > 
> >



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114268): https://edk2.groups.io/g/devel/message/114268
Mute This Topic: https://groups.io/mt/103921658/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-01-24  6:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-23 23:15 [edk2-devel] [PATCH v2 1/1] MdePkg/BaseFdtLib: Rename standard functions Jeff Brasen via groups.io
2024-01-23 23:26 ` Michael D Kinney
2024-01-24  6:27   ` Michael D Kinney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox