Staging: ks7010: michael_mic: fixed macros coding style issue
authorBing Sun <sunbing@redflag-linux.com>
Tue, 19 Jul 2016 01:51:06 +0000 (09:51 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Aug 2016 14:35:13 +0000 (16:35 +0200)
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>
drivers/staging/ks7010/michael_mic.c

index e14c109b3cabd021c777daf2f4fe59f3621ff43b..d332678781d2dacb2e225f43154aea4207700367 100644 (file)
 #define getUInt32( A, B )      (uint32_t)(A[B+0] << 0) + (A[B+1] << 8) + (A[B+2] << 16) + (A[B+3] << 24)
 
 // Convert from UInt32 to Byte[] in a portable way
-#define putUInt32( A, B, C )   A[B+0] = (uint8_t) (C & 0xff);          \
-                               A[B+1] = (uint8_t) ((C>>8) & 0xff);     \
-                               A[B+2] = (uint8_t) ((C>>16) & 0xff);    \
-                               A[B+3] = (uint8_t) ((C>>24) & 0xff)
+#define putUInt32(A, B, C)                                     \
+do {                                                           \
+       A[B + 0] = (uint8_t)(C & 0xff);                         \
+       A[B + 1] = (uint8_t)((C >> 8) & 0xff);                  \
+       A[B + 2] = (uint8_t)((C >> 16) & 0xff);                 \
+       A[B + 3] = (uint8_t)((C >> 24) & 0xff);                 \
+} while (0)
 
 // Reset the state to the empty message.
-#define MichaelClear( A )      A->L = A->K0; \
-                               A->R = A->K1; \
-                               A->nBytesInM = 0;
+#define MichaelClear(A)                        \
+do {                                   \
+       A->L = A->K0;                   \
+       A->R = A->K1;                   \
+       A->nBytesInM = 0;               \
+} while (0)
 
 static
 void MichaelInitializeFunction(struct michel_mic_t *Mic, uint8_t * key)