common/sfc_efx/base: fix dereferencing null pointer
[dpdk.git] / drivers / common / iavf / iavf_osdep.h
index 0bf040d..76c186a 100644 (file)
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2017 Intel Corporation
+ * Copyright(c) 2017-2021 Intel Corporation
  */
 
 #ifndef _IAVF_OSDEP_H_
@@ -55,6 +55,15 @@ typedef uint64_t        s64;
 #define __be64          uint64_t
 #endif
 
+/* Avoid macro redefinition warning on Windows */
+#ifdef RTE_EXEC_ENV_WINDOWS
+#ifdef min
+#undef min
+#endif
+#ifdef max
+#undef max
+#endif
+#endif
 #define min(a, b) RTE_MIN(a, b)
 #define max(a, b) RTE_MAX(a, b)
 
@@ -149,12 +158,12 @@ struct iavf_dma_mem {
        u64 pa;
        u32 size;
        const void *zone;
-} __attribute__((packed));
+} __rte_packed;
 
 struct iavf_virt_mem {
        void *va;
        u32 size;
-} __attribute__((packed));
+} __rte_packed;
 
 /* SW spinlock */
 struct iavf_spinlock {