]> git.droids-corp.org - dpdk.git/commitdiff
replace used attributes
authorThomas Monjalon <thomas@monjalon.net>
Sun, 9 Feb 2020 19:43:11 +0000 (20:43 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 16 Apr 2020 16:30:58 +0000 (18:30 +0200)
The new macro __rte_used, forcing symbol to be generated,
is now used where appropriate for consistency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
lib/librte_eal/common/eal_common_options.c
lib/librte_eal/include/rte_common.h
lib/librte_eal/include/rte_dev.h
lib/librte_eal/include/rte_function_versioning.h

index 525e51e7de34971792aac946d98ad8e3486c888c..eaba611fae7187ed9c095483382433d627018d11 100644 (file)
@@ -111,7 +111,7 @@ static const char *default_solib_dir = RTE_EAL_PMD_PATH;
  * Note: PLEASE DO NOT ALTER THIS without making a corresponding
  * change to usertools/dpdk-pmdinfo.py
  */
-static const char dpdk_solib_path[] __attribute__((used)) =
+static const char dpdk_solib_path[] __rte_used =
 "DPDK_PLUGIN_PATH=" RTE_EAL_PMD_PATH;
 
 TAILQ_HEAD(device_option_list, device_option);
index 7a52b8584461c8d9a92b6fd933bf6ee425c4b408..9d92f1f36bdb0c3719eff0b07742580726e22c77 100644 (file)
@@ -91,6 +91,11 @@ typedef uint16_t unaligned_uint16_t;
  */
 #define __rte_weak __attribute__((__weak__))
 
+/**
+ * Force symbol to be generated even if it appears to be unused.
+ */
+#define __rte_used __attribute__((used))
+
 /*********** Macros to eliminate unused variable warnings ********/
 
 /**
index a5c35f00c0a684fbfd78fd7c21878f48620f0e33..c8d985fb5cf9d908d8802b165856c986ea7085fd 100644 (file)
@@ -205,17 +205,17 @@ typedef int (*rte_dev_cmp_t)(const struct rte_device *dev, const void *data);
 
 #define RTE_PMD_EXPORT_NAME(name, idx) \
 static const char RTE_PMD_EXPORT_NAME_ARRAY(this_pmd_name, idx) \
-__attribute__((used)) = RTE_STR(name)
+__rte_used = RTE_STR(name)
 
 #define DRV_EXP_TAG(name, tag) __##name##_##tag
 
 #define RTE_PMD_REGISTER_PCI_TABLE(name, table) \
-static const char DRV_EXP_TAG(name, pci_tbl_export)[] __attribute__((used)) = \
+static const char DRV_EXP_TAG(name, pci_tbl_export)[] __rte_used = \
 RTE_STR(table)
 
 #define RTE_PMD_REGISTER_PARAM_STRING(name, str) \
 static const char DRV_EXP_TAG(name, param_string_export)[] \
-__attribute__((used)) = str
+__rte_used = str
 
 /**
  * Advertise the list of kernel modules required to run this driver
@@ -240,7 +240,7 @@ __attribute__((used)) = str
  */
 #define RTE_PMD_REGISTER_KMOD_DEP(name, str) \
 static const char DRV_EXP_TAG(name, kmod_dep_export)[] \
-__attribute__((used)) = str
+__rte_used = str
 
 /**
  * Iteration context.
index c924351d5e96b773a603f3921e2d360b832c4288..b9f862d295468d76fd92ea0ec79d9808e09f69fc 100644 (file)
@@ -59,7 +59,7 @@
  * that it is being used as an implementation of a particular version of symbol
  * <b>.
  */
-#define __vsym __attribute__((used))
+#define __vsym __rte_used
 
 /*
  * MAP_STATIC_SYMBOL