public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [PATCH] RedfishPkg/RedfishCrtLib: remove multiple definitions.
@ 2023-10-23 14:17 Nickle Wang via groups.io
  2023-10-23 20:22 ` Mike Maslenkin
  2023-10-23 21:04 ` Pedro Falcato
  0 siblings, 2 replies; 6+ messages in thread
From: Nickle Wang via groups.io @ 2023-10-23 14:17 UTC (permalink / raw)
  To: devel; +Cc: Abner Chang, Igor Kulchytskyy, Nick Ramirez, Mike Maslenkin

There are two definitions for below functions in RedfishCrtLib.h. Create
this change to remote duplicated functions.
Function list: strcmp(), strncmp(), strncpy(), strcat(), strchr(),
strcasecmp(), strstr(), memcmp(), memset(), memcpy() and memchr().

Signed-off-by: Nickle Wang <nicklew@nvidia.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Cc: Mike Maslenkin <mike.maslenkin@gmail.com>
---
 RedfishPkg/Include/Library/RedfishCrtLib.h | 81 +---------------------
 1 file changed, 1 insertion(+), 80 deletions(-)

diff --git a/RedfishPkg/Include/Library/RedfishCrtLib.h b/RedfishPkg/Include/Library/RedfishCrtLib.h
index 23c6acfca33e..80f0e10de8e7 100644
--- a/RedfishPkg/Include/Library/RedfishCrtLib.h
+++ b/RedfishPkg/Include/Library/RedfishCrtLib.h
@@ -3,6 +3,7 @@
 
   Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
   (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
+  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 
     SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -172,20 +173,6 @@ free        (
   void *
   );
 
-void           *
-memset     (
-  void *,
-  int,
-  size_t
-  );
-
-int
-memcmp      (
-  const void *,
-  const void *,
-  size_t
-  );
-
 int
 isdigit     (
   int
@@ -216,27 +203,6 @@ isalnum     (
   int
   );
 
-void           *
-memcpy     (
-  void *,
-  const void *,
-  size_t
-  );
-
-void           *
-memset     (
-  void *,
-  int,
-  size_t
-  );
-
-void           *
-memchr     (
-  const void *,
-  int,
-  size_t
-  );
-
 int
 memcmp      (
   const void *,
@@ -251,12 +217,6 @@ memmove    (
   size_t
   );
 
-int
-strcmp      (
-  const char *,
-  const char *
-  );
-
 int
 strncmp     (
   const char *,
@@ -275,24 +235,6 @@ strlen      (
   const char *
   );
 
-char           *
-strcat     (
-  char *,
-  const char *
-  );
-
-char           *
-strchr     (
-  const char *,
-  int
-  );
-
-int
-strcasecmp  (
-  const char *,
-  const char *
-  );
-
 int
 strncasecmp (
   const char *,
@@ -300,21 +242,6 @@ strncasecmp (
   size_t
   );
 
-char           *
-strncpy    (
-  char *,
-  size_t,
-  const char *,
-  size_t
-  );
-
-int
-strncmp     (
-  const char *,
-  const char *,
-  size_t
-  );
-
 char           *
 strrchr    (
   const char *,
@@ -328,12 +255,6 @@ strtoul     (
   int
   );
 
-char *
-strstr      (
-  const char  *s1,
-  const char  *s2
-  );
-
 long
 strtol      (
   const char *,
-- 
2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109925): https://edk2.groups.io/g/devel/message/109925
Mute This Topic: https://groups.io/mt/102136148/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] 6+ messages in thread

* Re: [edk2-devel] [PATCH] RedfishPkg/RedfishCrtLib: remove multiple definitions.
  2023-10-23 14:17 [edk2-devel] [PATCH] RedfishPkg/RedfishCrtLib: remove multiple definitions Nickle Wang via groups.io
@ 2023-10-23 20:22 ` Mike Maslenkin
  2023-10-25 12:40   ` Nickle Wang via groups.io
  2023-10-23 21:04 ` Pedro Falcato
  1 sibling, 1 reply; 6+ messages in thread
From: Mike Maslenkin @ 2023-10-23 20:22 UTC (permalink / raw)
  To: Nickle Wang; +Cc: devel, Abner Chang, Igor Kulchytskyy, Nick Ramirez

On Mon, Oct 23, 2023 at 5:18 PM Nickle Wang <nicklew@nvidia.com> wrote:
>
> There are two definitions for below functions in RedfishCrtLib.h. Create
> this change to remote duplicated functions.
> Function list: strcmp(), strncmp(), strncpy(), strcat(), strchr(),
> strcasecmp(), strstr(), memcmp(), memset(), memcpy() and memchr().
>
> Signed-off-by: Nickle Wang <nicklew@nvidia.com>
> Cc: Abner Chang <abner.chang@amd.com>
> Cc: Igor Kulchytskyy <igork@ami.com>
> Cc: Nick Ramirez <nramirez@nvidia.com>
> Cc: Mike Maslenkin <mike.maslenkin@gmail.com>
> ---
>  RedfishPkg/Include/Library/RedfishCrtLib.h | 81 +---------------------
>  1 file changed, 1 insertion(+), 80 deletions(-)
>
> diff --git a/RedfishPkg/Include/Library/RedfishCrtLib.h b/RedfishPkg/Include/Library/RedfishCrtLib.h
> index 23c6acfca33e..80f0e10de8e7 100644
> --- a/RedfishPkg/Include/Library/RedfishCrtLib.h
> +++ b/RedfishPkg/Include/Library/RedfishCrtLib.h
> @@ -3,6 +3,7 @@
>
>    Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
>    (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
> +  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
>
>      SPDX-License-Identifier: BSD-2-Clause-Patent
>
> @@ -172,20 +173,6 @@ free        (
>    void *
>    );
>
> -void           *
> -memset     (
> -  void *,
> -  int,
> -  size_t
> -  );
> -
> -int
> -memcmp      (
> -  const void *,
> -  const void *,
> -  size_t
> -  );
> -
>  int
>  isdigit     (
>    int
> @@ -216,27 +203,6 @@ isalnum     (
>    int
>    );
>
> -void           *
> -memcpy     (
> -  void *,
> -  const void *,
> -  size_t
> -  );
> -
> -void           *
> -memset     (
> -  void *,
> -  int,
> -  size_t
> -  );
> -
> -void           *
> -memchr     (
> -  const void *,
> -  int,
> -  size_t
> -  );
> -
>  int
>  memcmp      (
>    const void *,
> @@ -251,12 +217,6 @@ memmove    (
>    size_t
>    );
>
> -int
> -strcmp      (
> -  const char *,
> -  const char *
> -  );
> -
>  int
>  strncmp     (
>    const char *,
> @@ -275,24 +235,6 @@ strlen      (
>    const char *
>    );
>
> -char           *
> -strcat     (
> -  char *,
> -  const char *
> -  );
> -
> -char           *
> -strchr     (
> -  const char *,
> -  int
> -  );
> -
> -int
> -strcasecmp  (
> -  const char *,
> -  const char *
> -  );
> -
>  int
>  strncasecmp (
>    const char *,
> @@ -300,21 +242,6 @@ strncasecmp (
>    size_t
>    );
>
> -char           *
> -strncpy    (
> -  char *,
> -  size_t,
> -  const char *,
> -  size_t
> -  );
> -
> -int
> -strncmp     (
> -  const char *,
> -  const char *,
> -  size_t
> -  );
> -
>  char           *
>  strrchr    (
>    const char *,
> @@ -328,12 +255,6 @@ strtoul     (
>    int
>    );
>
> -char *
> -strstr      (
> -  const char  *s1,
> -  const char  *s2
> -  );
> -
>  long
>  strtol      (
>    const char *,
> --
> 2.17.1
>

Hi Nickle

double declaration of 'strcpy' is still there.

Best regards,
Mike.


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



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

* Re: [edk2-devel] [PATCH] RedfishPkg/RedfishCrtLib: remove multiple definitions.
  2023-10-23 14:17 [edk2-devel] [PATCH] RedfishPkg/RedfishCrtLib: remove multiple definitions Nickle Wang via groups.io
  2023-10-23 20:22 ` Mike Maslenkin
@ 2023-10-23 21:04 ` Pedro Falcato
  1 sibling, 0 replies; 6+ messages in thread
From: Pedro Falcato @ 2023-10-23 21:04 UTC (permalink / raw)
  To: devel, nicklew
  Cc: Abner Chang, Igor Kulchytskyy, Nick Ramirez, Mike Maslenkin

On Mon, Oct 23, 2023 at 3:18 PM Nickle Wang via groups.io
<nicklew=nvidia.com@groups.io> wrote:
>
> There are two definitions for below functions in RedfishCrtLib.h. Create
> this change to remote duplicated functions.
> Function list: strcmp(), strncmp(), strncpy(), strcat(), strchr(),
> strcasecmp(), strstr(), memcmp(), memset(), memcpy() and memchr().
>
> Signed-off-by: Nickle Wang <nicklew@nvidia.com>
> Cc: Abner Chang <abner.chang@amd.com>
> Cc: Igor Kulchytskyy <igork@ami.com>
> Cc: Nick Ramirez <nramirez@nvidia.com>
> Cc: Mike Maslenkin <mike.maslenkin@gmail.com>
> ---
>  RedfishPkg/Include/Library/RedfishCrtLib.h | 81 +---------------------
>  1 file changed, 1 insertion(+), 80 deletions(-)
>
> diff --git a/RedfishPkg/Include/Library/RedfishCrtLib.h b/RedfishPkg/Include/Library/RedfishCrtLib.h
> index 23c6acfca33e..80f0e10de8e7 100644
> --- a/RedfishPkg/Include/Library/RedfishCrtLib.h
> +++ b/RedfishPkg/Include/Library/RedfishCrtLib.h
> @@ -3,6 +3,7 @@
>
>    Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
>    (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
> +  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.

Can we take it easy with the copyright lines? This patch has literally
no additions apart from this copyright line, how can someone ever
claim copyright over this patch...

-- 
Pedro


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



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

* Re: [edk2-devel] [PATCH] RedfishPkg/RedfishCrtLib: remove multiple definitions.
  2023-10-23 20:22 ` Mike Maslenkin
@ 2023-10-25 12:40   ` Nickle Wang via groups.io
  2023-10-29 13:57     ` Mike Maslenkin
  0 siblings, 1 reply; 6+ messages in thread
From: Nickle Wang via groups.io @ 2023-10-25 12:40 UTC (permalink / raw)
  To: devel@edk2.groups.io, mike.maslenkin@gmail.com
  Cc: Abner Chang, Igor Kulchytskyy, Nick Ramirez

> double declaration of 'strcpy' is still there.

Thanks for catching this, Mike. Version 2 patch file was sent.

Regards,
Nickle

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Mike
> Maslenkin via groups.io
> Sent: Tuesday, October 24, 2023 4:23 AM
> To: Nickle Wang <nicklew@nvidia.com>
> Cc: devel@edk2.groups.io; Abner Chang <abner.chang@amd.com>; Igor
> Kulchytskyy <igork@ami.com>; Nick Ramirez <nramirez@nvidia.com>
> Subject: Re: [edk2-devel] [PATCH] RedfishPkg/RedfishCrtLib: remove multiple
> definitions.
> 
> External email: Use caution opening links or attachments
> 
> 
> On Mon, Oct 23, 2023 at 5:18 PM Nickle Wang <nicklew@nvidia.com> wrote:
> >
> > There are two definitions for below functions in RedfishCrtLib.h.
> > Create this change to remote duplicated functions.
> > Function list: strcmp(), strncmp(), strncpy(), strcat(), strchr(),
> > strcasecmp(), strstr(), memcmp(), memset(), memcpy() and memchr().
> >
> > Signed-off-by: Nickle Wang <nicklew@nvidia.com>
> > Cc: Abner Chang <abner.chang@amd.com>
> > Cc: Igor Kulchytskyy <igork@ami.com>
> > Cc: Nick Ramirez <nramirez@nvidia.com>
> > Cc: Mike Maslenkin <mike.maslenkin@gmail.com>
> > ---
> >  RedfishPkg/Include/Library/RedfishCrtLib.h | 81
> > +---------------------
> >  1 file changed, 1 insertion(+), 80 deletions(-)
> >
> > diff --git a/RedfishPkg/Include/Library/RedfishCrtLib.h
> > b/RedfishPkg/Include/Library/RedfishCrtLib.h
> > index 23c6acfca33e..80f0e10de8e7 100644
> > --- a/RedfishPkg/Include/Library/RedfishCrtLib.h
> > +++ b/RedfishPkg/Include/Library/RedfishCrtLib.h
> > @@ -3,6 +3,7 @@
> >
> >    Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
> >    (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
> > +  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
> >
> >      SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> > @@ -172,20 +173,6 @@ free        (
> >    void *
> >    );
> >
> > -void           *
> > -memset     (
> > -  void *,
> > -  int,
> > -  size_t
> > -  );
> > -
> > -int
> > -memcmp      (
> > -  const void *,
> > -  const void *,
> > -  size_t
> > -  );
> > -
> >  int
> >  isdigit     (
> >    int
> > @@ -216,27 +203,6 @@ isalnum     (
> >    int
> >    );
> >
> > -void           *
> > -memcpy     (
> > -  void *,
> > -  const void *,
> > -  size_t
> > -  );
> > -
> > -void           *
> > -memset     (
> > -  void *,
> > -  int,
> > -  size_t
> > -  );
> > -
> > -void           *
> > -memchr     (
> > -  const void *,
> > -  int,
> > -  size_t
> > -  );
> > -
> >  int
> >  memcmp      (
> >    const void *,
> > @@ -251,12 +217,6 @@ memmove    (
> >    size_t
> >    );
> >
> > -int
> > -strcmp      (
> > -  const char *,
> > -  const char *
> > -  );
> > -
> >  int
> >  strncmp     (
> >    const char *,
> > @@ -275,24 +235,6 @@ strlen      (
> >    const char *
> >    );
> >
> > -char           *
> > -strcat     (
> > -  char *,
> > -  const char *
> > -  );
> > -
> > -char           *
> > -strchr     (
> > -  const char *,
> > -  int
> > -  );
> > -
> > -int
> > -strcasecmp  (
> > -  const char *,
> > -  const char *
> > -  );
> > -
> >  int
> >  strncasecmp (
> >    const char *,
> > @@ -300,21 +242,6 @@ strncasecmp (
> >    size_t
> >    );
> >
> > -char           *
> > -strncpy    (
> > -  char *,
> > -  size_t,
> > -  const char *,
> > -  size_t
> > -  );
> > -
> > -int
> > -strncmp     (
> > -  const char *,
> > -  const char *,
> > -  size_t
> > -  );
> > -
> >  char           *
> >  strrchr    (
> >    const char *,
> > @@ -328,12 +255,6 @@ strtoul     (
> >    int
> >    );
> >
> > -char *
> > -strstr      (
> > -  const char  *s1,
> > -  const char  *s2
> > -  );
> > -
> >  long
> >  strtol      (
> >    const char *,
> > --
> > 2.17.1
> >
> 
> Hi Nickle
> 
> double declaration of 'strcpy' is still there.
> 
> Best regards,
> Mike.
> 
> 
> 
> 



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



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

* Re: [edk2-devel] [PATCH] RedfishPkg/RedfishCrtLib: remove multiple definitions.
  2023-10-25 12:40   ` Nickle Wang via groups.io
@ 2023-10-29 13:57     ` Mike Maslenkin
  2023-10-31 12:59       ` Nickle Wang via groups.io
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Maslenkin @ 2023-10-29 13:57 UTC (permalink / raw)
  To: Nickle Wang
  Cc: devel@edk2.groups.io, Abner Chang, Igor Kulchytskyy, Nick Ramirez

On Wed, Oct 25, 2023 at 3:40 PM Nickle Wang <nicklew@nvidia.com> wrote:
>
> > double declaration of 'strcpy' is still there.
>
> Thanks for catching this, Mike. Version 2 patch file was sent.
>
> Regards,
> Nickle

Hello, Nickle

v2 is good enough, but it can be improved a bit.

Since the definitions in this header file have become clearer and simpler,
It now appears that memcmp and memmove declarations can also be removed.

The logic is that we don't need to declare function prototypes for
those that are overridden at the bottom of this header file.
If there were such functions in the code, the linking process would
fail, but there should not be such functions, since their names are
replaced by the preprocessor according to the definitions.

Regards,
Mike.


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



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

* Re: [edk2-devel] [PATCH] RedfishPkg/RedfishCrtLib: remove multiple definitions.
  2023-10-29 13:57     ` Mike Maslenkin
@ 2023-10-31 12:59       ` Nickle Wang via groups.io
  0 siblings, 0 replies; 6+ messages in thread
From: Nickle Wang via groups.io @ 2023-10-31 12:59 UTC (permalink / raw)
  To: Mike Maslenkin
  Cc: devel@edk2.groups.io, Abner Chang, Igor Kulchytskyy, Nick Ramirez

Thanks Mike! By following the logic, strlen() can be removed too. Version 3 patch is here: https://edk2.groups.io/g/devel/message/110408 I removed memcmp, memmove, and strlen.

Regards,
Nickle

> -----Original Message-----
> From: Mike Maslenkin <mike.maslenkin@gmail.com>
> Sent: Sunday, October 29, 2023 9:58 PM
> To: Nickle Wang <nicklew@nvidia.com>
> Cc: devel@edk2.groups.io; Abner Chang <abner.chang@amd.com>; Igor
> Kulchytskyy <igork@ami.com>; Nick Ramirez <nramirez@nvidia.com>
> Subject: Re: [edk2-devel] [PATCH] RedfishPkg/RedfishCrtLib: remove multiple
> definitions.
> 
> External email: Use caution opening links or attachments
> 
> 
> On Wed, Oct 25, 2023 at 3:40 PM Nickle Wang <nicklew@nvidia.com> wrote:
> >
> > > double declaration of 'strcpy' is still there.
> >
> > Thanks for catching this, Mike. Version 2 patch file was sent.
> >
> > Regards,
> > Nickle
> 
> Hello, Nickle
> 
> v2 is good enough, but it can be improved a bit.
> 
> Since the definitions in this header file have become clearer and simpler, It now
> appears that memcmp and memmove declarations can also be removed.
> 
> The logic is that we don't need to declare function prototypes for those that are
> overridden at the bottom of this header file.
> If there were such functions in the code, the linking process would fail, but there
> should not be such functions, since their names are replaced by the preprocessor
> according to the definitions.
> 
> Regards,
> Mike.


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



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

end of thread, other threads:[~2023-10-31 12:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-23 14:17 [edk2-devel] [PATCH] RedfishPkg/RedfishCrtLib: remove multiple definitions Nickle Wang via groups.io
2023-10-23 20:22 ` Mike Maslenkin
2023-10-25 12:40   ` Nickle Wang via groups.io
2023-10-29 13:57     ` Mike Maslenkin
2023-10-31 12:59       ` Nickle Wang via groups.io
2023-10-23 21:04 ` Pedro Falcato

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