From: Gilad Ben-Yossef Date: Sun, 7 May 2017 13:36:03 +0000 (+0300) Subject: staging: ccree: fix checkpatch errors in macro def X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=54ee8341a9826fa72f2adce0b0b1bccf13e85eab;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git staging: ccree: fix checkpatch errors in macro def Fix various checkpatch warnings and errors in LLI macro definitions Signed-off-by: Gilad Ben-Yossef Signed-off-by: Greg Kroah-Hartman --- 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