net/dpaa2: fix build with musl

Message ID 20220201095332.834143-1-thomas@monjalon.net (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/dpaa2: fix build with musl |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/github-robot: build success github build: passed
ci/intel-Testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS

Commit Message

Thomas Monjalon Feb. 1, 2022, 9:53 a.m. UTC
  PAGE_SIZE is already defined in musl libc:

drivers/net/dpaa2/dpaa2_recycle.c:35: error: "PAGE_SIZE" redefined
/usr/include/limits.h:97: note:
   this is the location of the previous definition
   97 | #define PAGE_SIZE PAGESIZE

Fixes: f023d059769f ("net/dpaa2: support recycle loopback port")

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/net/dpaa2/dpaa2_recycle.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Nipun Gupta Feb. 1, 2022, 10:10 a.m. UTC | #1
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>

> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: 01 February 2022 15:24
> To: dev@dpdk.org
> Cc: Jun Yang <jun.yang@nxp.com>; Nipun Gupta <nipun.gupta@nxp.com>;
> Hemant Agrawal <hemant.agrawal@nxp.com>; David Marchand
> <david.marchand@redhat.com>; Sachin Saxena (OSS)
> <sachin.saxena@oss.nxp.com>
> Subject: [PATCH] net/dpaa2: fix build with musl
> 
> PAGE_SIZE is already defined in musl libc:
> 
> drivers/net/dpaa2/dpaa2_recycle.c:35: error: "PAGE_SIZE" redefined
> /usr/include/limits.h:97: note:
>    this is the location of the previous definition
>    97 | #define PAGE_SIZE PAGESIZE
> 
> Fixes: f023d059769f ("net/dpaa2: support recycle loopback port")
> 
> Reported-by: David Marchand <david.marchand@redhat.com>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>  drivers/net/dpaa2/dpaa2_recycle.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/dpaa2/dpaa2_recycle.c
> b/drivers/net/dpaa2/dpaa2_recycle.c
> index c5e9e9721d..336506dc0d 100644
> --- a/drivers/net/dpaa2/dpaa2_recycle.c
> +++ b/drivers/net/dpaa2/dpaa2_recycle.c
> @@ -32,7 +32,9 @@
>  #include <unistd.h>
>  #include <sys/mman.h>
> 
> +#ifndef PAGE_SIZE
>  #define PAGE_SIZE			(sysconf(_SC_PAGESIZE))
> +#endif
>  #define PAGE_MASK			(~(PAGE_SIZE - 1))
> 
>  #define LSX_SERDES_LAN_NB		8
> --
> 2.34.1
  
Thomas Monjalon Feb. 1, 2022, 11:03 a.m. UTC | #2
> > PAGE_SIZE is already defined in musl libc:
> > 
> > drivers/net/dpaa2/dpaa2_recycle.c:35: error: "PAGE_SIZE" redefined
> > /usr/include/limits.h:97: note:
> >    this is the location of the previous definition
> >    97 | #define PAGE_SIZE PAGESIZE
> > 
> > Fixes: f023d059769f ("net/dpaa2: support recycle loopback port")
> > 
> > Reported-by: David Marchand <david.marchand@redhat.com>
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> Acked-by: Nipun Gupta <nipun.gupta@nxp.com>

Applied
  

Patch

diff --git a/drivers/net/dpaa2/dpaa2_recycle.c b/drivers/net/dpaa2/dpaa2_recycle.c
index c5e9e9721d..336506dc0d 100644
--- a/drivers/net/dpaa2/dpaa2_recycle.c
+++ b/drivers/net/dpaa2/dpaa2_recycle.c
@@ -32,7 +32,9 @@ 
 #include <unistd.h>
 #include <sys/mman.h>
 
+#ifndef PAGE_SIZE
 #define PAGE_SIZE			(sysconf(_SC_PAGESIZE))
+#endif
 #define PAGE_MASK			(~(PAGE_SIZE - 1))
 
 #define LSX_SERDES_LAN_NB		8