From b0656053332f5698aafeb875af9ef428aef65153 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 19 Jan 2014 09:04:16 +0000 Subject: [PATCH] mpt: Avoid that checkpatch complains about stm_[gs]et_dma_addr() git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5205 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- mpt/mpt_scst.h | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/mpt/mpt_scst.h b/mpt/mpt_scst.h index c29e1609a..98d11fcab 100644 --- a/mpt/mpt_scst.h +++ b/mpt/mpt_scst.h @@ -251,22 +251,26 @@ typedef struct _MPT_STM_PRIV { #define MPT_STM_SIMPLE SGESimple64_t #define MPT_STM_CHAIN SGEChain64_t #define MPI_SGE_FLAGS_MPT_STM_ADDRESSING MPI_SGE_FLAGS_64_BIT_ADDRESSING -#define stm_get_dma_addr(x, y) \ - x = le32_to_cpu(y.Low); \ - if (sizeof(dma_addr_t) == sizeof(u64)) \ - x |= (u64)le32_to_cpu(y.High)<<32; -#define stm_set_dma_addr(x, y) \ - x.Low = cpu_to_le32(y); \ - if (sizeof(dma_addr_t) == sizeof(u64)) \ - x.High = cpu_to_le32((u64)y>>32); \ - else \ - x.High = 0; +#define stm_get_dma_addr(x, y) \ + do { \ + (x) = le32_to_cpu((y).Low); \ + if (sizeof(dma_addr_t) == sizeof(u64)) \ + (x) |= (u64)le32_to_cpu((y).High)<<32; \ + } while (0) +#define stm_set_dma_addr(x, y) \ + do { \ + (x).Low = cpu_to_le32((y)); \ + if (sizeof(dma_addr_t) == sizeof(u64)) \ + (x).High = cpu_to_le32((u64)(y)>>32); \ + else \ + (x).High = 0; \ + } while (0) #else #define MPT_STM_SIMPLE SGESimple32_t #define MPT_STM_CHAIN SGEChain32_t #define MPI_SGE_FLAGS_MPT_STM_ADDRESSING MPI_SGE_FLAGS_32_BIT_ADDRESSING -#define stm_get_dma_addr(x, y) x = le32_to_cpu(y); -#define stm_set_dma_addr(x, y) x = cpu_to_le32(y); +#define stm_get_dma_addr(x, y) ((x) = le32_to_cpu((y))) +#define stm_set_dma_addr(x, y) ((x) = cpu_to_le32((y))) #endif #ifndef MPT_MAX_ADAPTERS