Skip to content

Commit f1ff866

Browse files
Yuval Mintzdavem330
authored andcommitted
qed: Fix address macros
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: 05fafbf ("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>
1 parent e55dddf commit f1ff866

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

include/linux/qed/common_hsi.h

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,17 @@
1313
#include <linux/slab.h>
1414

1515
/* dma_addr_t manip */
16-
#define DMA_LO(x) ((u32)(((dma_addr_t)(x)) & 0xffffffff))
17-
#define DMA_HI(x) ((u32)(((dma_addr_t)(x)) >> 32))
18-
19-
#define DMA_LO_LE(x) cpu_to_le32(DMA_LO(x))
20-
#define DMA_HI_LE(x) cpu_to_le32(DMA_HI(x))
21-
22-
/* It's assumed that whoever includes this has previously included an hsi
23-
* file defining the regpair.
24-
*/
25-
#define DMA_REGPAIR_LE(x, val) (x).hi = DMA_HI_LE((val)); \
26-
(x).lo = DMA_LO_LE((val))
16+
#define DMA_LO_LE(x) cpu_to_le32(lower_32_bits(x))
17+
#define DMA_HI_LE(x) cpu_to_le32(upper_32_bits(x))
18+
#define DMA_REGPAIR_LE(x, val) do { \
19+
(x).hi = DMA_HI_LE((val)); \
20+
(x).lo = DMA_LO_LE((val)); \
21+
} while (0)
2722

2823
#define HILO_GEN(hi, lo, type) ((((type)(hi)) << 32) + (lo))
29-
#define HILO_DMA(hi, lo) HILO_GEN(hi, lo, dma_addr_t)
30-
#define HILO_64(hi, lo) HILO_GEN(hi, lo, u64)
31-
#define HILO_DMA_REGPAIR(regpair) (HILO_DMA(regpair.hi, regpair.lo))
24+
#define HILO_64(hi, lo) HILO_GEN((le32_to_cpu(hi)), (le32_to_cpu(lo)), u64)
3225
#define HILO_64_REGPAIR(regpair) (HILO_64(regpair.hi, regpair.lo))
26+
#define HILO_DMA_REGPAIR(regpair) ((dma_addr_t)HILO_64_REGPAIR(regpair))
3327

3428
#ifndef __COMMON_HSI__
3529
#define __COMMON_HSI__

0 commit comments

Comments
 (0)