aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBing Sun <sunbing@redflag-linux.com>2016-07-18 21:51:06 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-08-15 10:35:13 -0400
commit6bef3f01398dc12532873f8b2376dba1339908bb (patch)
tree3b1ef86ef30c0da5db53450940db887877b78243
parent695872eae5cb8292ad5a748451453468f0576001 (diff)
Staging: ks7010: michael_mic: fixed macros coding style issue
Fixed coding style issue: Enclose multiple statements macros definition in a do while loop. Use one space around binary operators. Signed-off-by: Bing Sun <sunbing@redflag-linux.com> Reviewed-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/ks7010/michael_mic.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/staging/ks7010/michael_mic.c b/drivers/staging/ks7010/michael_mic.c
index e14c109b3cab..d332678781d2 100644
--- a/drivers/staging/ks7010/michael_mic.c
+++ b/drivers/staging/ks7010/michael_mic.c
@@ -20,15 +20,21 @@
20#define getUInt32( A, B ) (uint32_t)(A[B+0] << 0) + (A[B+1] << 8) + (A[B+2] << 16) + (A[B+3] << 24) 20#define getUInt32( A, B ) (uint32_t)(A[B+0] << 0) + (A[B+1] << 8) + (A[B+2] << 16) + (A[B+3] << 24)
21 21
22// Convert from UInt32 to Byte[] in a portable way 22// Convert from UInt32 to Byte[] in a portable way
23#define putUInt32( A, B, C ) A[B+0] = (uint8_t) (C & 0xff); \ 23#define putUInt32(A, B, C) \
24 A[B+1] = (uint8_t) ((C>>8) & 0xff); \ 24do { \
25 A[B+2] = (uint8_t) ((C>>16) & 0xff); \ 25 A[B + 0] = (uint8_t)(C & 0xff); \
26 A[B+3] = (uint8_t) ((C>>24) & 0xff) 26 A[B + 1] = (uint8_t)((C >> 8) & 0xff); \
27 A[B + 2] = (uint8_t)((C >> 16) & 0xff); \
28 A[B + 3] = (uint8_t)((C >> 24) & 0xff); \
29} while (0)
27 30
28// Reset the state to the empty message. 31// Reset the state to the empty message.
29#define MichaelClear( A ) A->L = A->K0; \ 32#define MichaelClear(A) \
30 A->R = A->K1; \ 33do { \
31 A->nBytesInM = 0; 34 A->L = A->K0; \
35 A->R = A->K1; \
36 A->nBytesInM = 0; \
37} while (0)
32 38
33static 39static
34void MichaelInitializeFunction(struct michel_mic_t *Mic, uint8_t * key) 40void MichaelInitializeFunction(struct michel_mic_t *Mic, uint8_t * key)