[07/10] compress/octeontx: fix global variable multiple definitions
diff mbox series

Message ID 20190905145315.19395-8-ferruh.yigit@intel.com
State Accepted
Delegated to: David Marchand
Headers show
Series
  • fix global variable multiple definitions
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Ferruh Yigit Sept. 5, 2019, 2:53 p.m. UTC
'octtx_zip_logtype_driver' global variable is defined in a header file
which was causing multiple definitions of the variable, fixed it by
moving it to the .c file.

Issue has been detected by '-fno-common' gcc flag.

Fixes: 43e610bb8565 ("compress/octeontx: introduce octeontx zip PMD")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 drivers/compress/octeontx/otx_zip.h     | 2 +-
 drivers/compress/octeontx/otx_zip_pmd.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

Comments

Ashish Gupta Sept. 5, 2019, 4 p.m. UTC | #1
> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> Sent: Thursday, September 5, 2019 8:53 PM
> To: Ashish Gupta <ashishg@marvell.com>; Fiona Trahe
> <fiona.trahe@intel.com>; Pablo de Lara <pablo.de.lara.guarch@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: [EXT] [PATCH 07/10] compress/octeontx: fix global variable multiple
> definitions
> 
> External Email
> 
> ----------------------------------------------------------------------
> 'octtx_zip_logtype_driver' global variable is defined in a header file which
> was causing multiple definitions of the variable, fixed it by moving it to the .c
> file.
> 
> Issue has been detected by '-fno-common' gcc flag.
> 
> Fixes: 43e610bb8565 ("compress/octeontx: introduce octeontx zip PMD")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
>  drivers/compress/octeontx/otx_zip.h     | 2 +-
>  drivers/compress/octeontx/otx_zip_pmd.c | 2 ++
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/compress/octeontx/otx_zip.h
> b/drivers/compress/octeontx/otx_zip.h
> index 3abefd1dc..e43f7f5c3 100644
> --- a/drivers/compress/octeontx/otx_zip.h
> +++ b/drivers/compress/octeontx/otx_zip.h
> @@ -17,7 +17,7 @@
> 
>  #include <zip_regs.h>
> 
> -int octtx_zip_logtype_driver;
> +extern int octtx_zip_logtype_driver;
> 
>  /* ZIP VF Control/Status registers (CSRs): */
>  /* VF_BAR0: */
> diff --git a/drivers/compress/octeontx/otx_zip_pmd.c
> b/drivers/compress/octeontx/otx_zip_pmd.c
> index a1651b22e..9e00c8663 100644
> --- a/drivers/compress/octeontx/otx_zip_pmd.c
> +++ b/drivers/compress/octeontx/otx_zip_pmd.c
> @@ -11,6 +11,8 @@
> 
>  #include "otx_zip.h"
> 
> +int octtx_zip_logtype_driver;
> +
>  static const struct rte_compressdev_capabilities
>  				octtx_zip_pmd_capabilities[] = {
>  	{	.algo = RTE_COMP_ALGO_DEFLATE,
> --
> 2.21.0

Acked-by: Ashish Gupta <ashishg@marvell.com>

Patch
diff mbox series

diff --git a/drivers/compress/octeontx/otx_zip.h b/drivers/compress/octeontx/otx_zip.h
index 3abefd1dc..e43f7f5c3 100644
--- a/drivers/compress/octeontx/otx_zip.h
+++ b/drivers/compress/octeontx/otx_zip.h
@@ -17,7 +17,7 @@ 
 
 #include <zip_regs.h>
 
-int octtx_zip_logtype_driver;
+extern int octtx_zip_logtype_driver;
 
 /* ZIP VF Control/Status registers (CSRs): */
 /* VF_BAR0: */
diff --git a/drivers/compress/octeontx/otx_zip_pmd.c b/drivers/compress/octeontx/otx_zip_pmd.c
index a1651b22e..9e00c8663 100644
--- a/drivers/compress/octeontx/otx_zip_pmd.c
+++ b/drivers/compress/octeontx/otx_zip_pmd.c
@@ -11,6 +11,8 @@ 
 
 #include "otx_zip.h"
 
+int octtx_zip_logtype_driver;
+
 static const struct rte_compressdev_capabilities
 				octtx_zip_pmd_capabilities[] = {
 	{	.algo = RTE_COMP_ALGO_DEFLATE,