[03/10] crypto/null: fix global variable multiple definitions
diff mbox series

Message ID 20190905145315.19395-4-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
'null_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: 735b783d8c2b ("crypto/null: add dynamic logging")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 drivers/crypto/null/null_crypto_pmd.c         | 1 +
 drivers/crypto/null/null_crypto_pmd_private.h | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/drivers/crypto/null/null_crypto_pmd.c b/drivers/crypto/null/null_crypto_pmd.c
index d5e3064f2..f11636c5f 100644
--- a/drivers/crypto/null/null_crypto_pmd.c
+++ b/drivers/crypto/null/null_crypto_pmd.c
@@ -10,6 +10,7 @@ 
 #include "null_crypto_pmd_private.h"
 
 static uint8_t cryptodev_driver_id;
+int null_logtype_driver;
 
 /** verify and set session parameters */
 int
diff --git a/drivers/crypto/null/null_crypto_pmd_private.h b/drivers/crypto/null/null_crypto_pmd_private.h
index d7bfd9cc8..89c4345b6 100644
--- a/drivers/crypto/null/null_crypto_pmd_private.h
+++ b/drivers/crypto/null/null_crypto_pmd_private.h
@@ -8,7 +8,7 @@ 
 #define CRYPTODEV_NAME_NULL_PMD		crypto_null
 /**< Null crypto PMD device name */
 
-int null_logtype_driver;
+extern int null_logtype_driver;
 
 #define NULL_LOG(level, fmt, ...)  \
 	rte_log(RTE_LOG_ ## level, null_logtype_driver,  \