DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] eal: fix Wbad-function-cast warning
@ 2015-03-16 12:56 John McNamara
  2015-03-16 13:19 ` Neil Horman
  2015-03-16 17:05 ` [dpdk-dev] [PATCH v2] " John McNamara
  0 siblings, 2 replies; 7+ messages in thread
From: John McNamara @ 2015-03-16 12:56 UTC (permalink / raw)
  To: dev

Fix a warning when the rte_common.h header is included in a compilation
using  -Wbad-function-cast, such as in Open vSwitch where the
following warning is emitted repeatedly:

    ../rte_common.h: In function 'rte_is_aligned':
    ../rte_common.h:184:9: warning: cast from function call of
    type 'uintptr_t' to non-matching type 'void *' [-Wbad-function-cast]

This change fixes the issue in rte_common.h by using the RTE_ALIGN_FLOOR
macro to get the aligned floor value with generic type casting.

Signed-off-by: John McNamara <john.mcnamara@intel.com>
---
 lib/librte_eal/common/include/rte_common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h
index 4971049..86b7e9b 100644
--- a/lib/librte_eal/common/include/rte_common.h
+++ b/lib/librte_eal/common/include/rte_common.h
@@ -120,7 +120,7 @@ rte_align_floor_int(uintptr_t ptr, uintptr_t align)
  * must be a power-of-two value.
  */
 #define RTE_PTR_ALIGN_FLOOR(ptr, align) \
-	(typeof(ptr))rte_align_floor_int((uintptr_t)ptr, align)
+	(typeof(ptr))RTE_ALIGN_FLOOR((uintptr_t)ptr, align)
 
 /**
  * Macro to align a value to a given power-of-two. The resultant value
-- 
1.8.1.4

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

end of thread, other threads:[~2015-03-16 23:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-16 12:56 [dpdk-dev] [PATCH] eal: fix Wbad-function-cast warning John McNamara
2015-03-16 13:19 ` Neil Horman
2015-03-16 15:04   ` Mcnamara, John
2015-03-16 15:45     ` Neil Horman
2015-03-16 17:05 ` [dpdk-dev] [PATCH v2] " John McNamara
2015-03-16 17:52   ` Neil Horman
2015-03-16 23:29     ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).