aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/ccree/cc_lli_defs.h
diff options
context:
space:
mode:
authorGilad Ben-Yossef <gilad@benyossef.com>2017-05-07 16:36:03 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-05-15 07:42:00 +0200
commit54ee8341a9826fa72f2adce0b0b1bccf13e85eab (patch)
treefa836b537f6e2fc00b015a6fadf44fdd846161bd /drivers/staging/ccree/cc_lli_defs.h
parent6adce0c93bef10fe6802247de1ad7af44836338b (diff)
staging: ccree: fix checkpatch errors in macro def
Fix various checkpatch warnings and errors in LLI macro definitions Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ccree/cc_lli_defs.h')
-rw-r--r--drivers/staging/ccree/cc_lli_defs.h28
1 files changed, 20 insertions, 8 deletions
diff --git a/drivers/staging/ccree/cc_lli_defs.h b/drivers/staging/ccree/cc_lli_defs.h
index c84b14226dc9..857b94fc9c58 100644
--- a/drivers/staging/ccree/cc_lli_defs.h
+++ b/drivers/staging/ccree/cc_lli_defs.h
@@ -21,17 +21,29 @@
#include "cc_bitops.h"
-/* Max DLLI size */
-#define DLLI_SIZE_BIT_SIZE 0x18 // DX_DSCRPTR_QUEUE_WORD1_DIN_SIZE_BIT_SIZE
+/* Max DLLI size
+ * AKA DX_DSCRPTR_QUEUE_WORD1_DIN_SIZE_BIT_SIZE
+ */
+#define DLLI_SIZE_BIT_SIZE 0x18
#define CC_MAX_MLLI_ENTRY_SIZE 0x10000
-#define LLI_SET_ADDR(lli_p, addr) \
- BITFIELD_SET(((u32 *)(lli_p))[LLI_WORD0_OFFSET], LLI_LADDR_BIT_OFFSET, LLI_LADDR_BIT_SIZE, (addr & U32_MAX)); \
- BITFIELD_SET(((u32 *)(lli_p))[LLI_WORD1_OFFSET], LLI_HADDR_BIT_OFFSET, LLI_HADDR_BIT_SIZE, MSB64(addr));
-
-#define LLI_SET_SIZE(lli_p, size) \
- BITFIELD_SET(((u32 *)(lli_p))[LLI_WORD1_OFFSET], LLI_SIZE_BIT_OFFSET, LLI_SIZE_BIT_SIZE, size)
+#define LLI_SET_ADDR(__lli_p, __addr) do { \
+ u32 *lli_p = (u32 *)__lli_p; \
+ typeof(__addr) addr = __addr; \
+ \
+ BITFIELD_SET(lli_p[LLI_WORD0_OFFSET], \
+ LLI_LADDR_BIT_OFFSET, \
+ LLI_LADDR_BIT_SIZE, (addr & U32_MAX)); \
+ \
+ BITFIELD_SET(lli_p[LLI_WORD1_OFFSET], \
+ LLI_HADDR_BIT_OFFSET, \
+ LLI_HADDR_BIT_SIZE, MSB64(addr)); \
+ } while (0)
+
+#define LLI_SET_SIZE(lli_p, size) \
+ BITFIELD_SET(((u32 *)(lli_p))[LLI_WORD1_OFFSET], \
+ LLI_SIZE_BIT_OFFSET, LLI_SIZE_BIT_SIZE, size)
/* Size of entry */
#define LLI_ENTRY_WORD_SIZE 2