]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
qed: Fix address macros
authorYuval Mintz <Yuval.Mintz@qlogic.com>
Tue, 23 Aug 2016 04:19:50 +0000 (07:19 +0300)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 6 Mar 2017 04:59:40 +0000 (20:59 -0800)
Orabug: 25477939

Last FW submission reverted various macros into an older form,
where they generate compilation warnings on some architectures.

Bring back the newer macros instead.

Fixes: 05fafbfb3d77 ("qed: utilize FW 8.10.10.0")
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit f1ff8666ed87b0013e45ce2d335085407bb38a60)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
include/linux/qed/common_hsi.h

index d306e0b55581a8786228ff9fb154a7620af86068..70b30e4d3cc42dcde753ac4b8d4c39193e12deaa 100644 (file)
 #include <linux/slab.h>
 
 /* dma_addr_t manip */
-#define DMA_LO(x)               ((u32)(((dma_addr_t)(x)) & 0xffffffff))
-#define DMA_HI(x)               ((u32)(((dma_addr_t)(x)) >> 32))
-
-#define DMA_LO_LE(x)            cpu_to_le32(DMA_LO(x))
-#define DMA_HI_LE(x)            cpu_to_le32(DMA_HI(x))
-
-/* It's assumed that whoever includes this has previously included an hsi
- * file defining the regpair.
- */
-#define DMA_REGPAIR_LE(x, val)  (x).hi = DMA_HI_LE((val)); \
-       (x).lo                          = DMA_LO_LE((val))
+#define DMA_LO_LE(x)           cpu_to_le32(lower_32_bits(x))
+#define DMA_HI_LE(x)           cpu_to_le32(upper_32_bits(x))
+#define DMA_REGPAIR_LE(x, val) do { \
+                                       (x).hi = DMA_HI_LE((val)); \
+                                       (x).lo = DMA_LO_LE((val)); \
+                               } while (0)
 
 #define HILO_GEN(hi, lo, type)  ((((type)(hi)) << 32) + (lo))
-#define HILO_DMA(hi, lo)        HILO_GEN(hi, lo, dma_addr_t)
-#define HILO_64(hi, lo)         HILO_GEN(hi, lo, u64)
-#define HILO_DMA_REGPAIR(regpair)       (HILO_DMA(regpair.hi, regpair.lo))
+#define HILO_64(hi, lo) HILO_GEN((le32_to_cpu(hi)), (le32_to_cpu(lo)), u64)
 #define HILO_64_REGPAIR(regpair)        (HILO_64(regpair.hi, regpair.lo))
+#define HILO_DMA_REGPAIR(regpair)      ((dma_addr_t)HILO_64_REGPAIR(regpair))
 
 #ifndef __COMMON_HSI__
 #define __COMMON_HSI__