eal/linux: fix illegal memory access in uevent handler
[dpdk.git] / lib / eal / include / rte_common.h
index d5a32c6..4a399cc 100644 (file)
@@ -623,7 +623,7 @@ rte_bsf32(uint32_t v)
  *     Returns 0 if ``v`` was 0, otherwise returns 1.
  */
 static inline int
-rte_bsf32_safe(uint64_t v, uint32_t *pos)
+rte_bsf32_safe(uint32_t v, uint32_t *pos)
 {
        if (v == 0)
                return 0;
@@ -778,6 +778,14 @@ rte_log2_u64(uint64_t v)
                })
 #endif
 
+/** Swap two variables. */
+#define RTE_SWAP(a, b) \
+       __extension__ ({ \
+               typeof (a) _a = a; \
+               a = b; \
+               b = _a; \
+       })
+
 /**
  * Get the size of a field in a structure.
  *