From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751312AbcGNJIG (ORCPT ); Thu, 14 Jul 2016 05:08:06 -0400 Received: from [220.194.60.87] ([220.194.60.87]:36845 "EHLO mail.redflag-linux.com" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751074AbcGNJHr (ORCPT ); Thu, 14 Jul 2016 05:07:47 -0400 X-Greylist: delayed 346 seconds by postgrey-1.27 at vger.kernel.org; Thu, 14 Jul 2016 05:07:47 EDT X-DSPAM-Processed: Thu Jul 14 16:52:07 2016 X-DSPAM-Confidence: 0.9946 X-DSPAM-Probability: 0.0000 X-Spam-Flag: NO X-Spam-Score: -2 X-DSPAM-Result: Innocent X-DSPAM-Signature: 1,578752b717301316825246 From: Sunbing To: gregkh@linuxfoundation.org, wsa+renesas@sang-engineering.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Cc: Sunbing , Sunbing Subject: [PATCH] Enclose multiple statements macros in a do while loop Date: Thu, 14 Jul 2016 17:01:51 +0800 Message-Id: <1468486911-10916-1-git-send-email-sunbing@redflag-linux.com> X-Mailer: git-send-email 2.1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The formatting of macros definetion in ks7010/michael_mic.c is not consistent with the general kernel coding style. Fix it by the result of scripts/checkpatch.pl. No functional changes. Signed-off-by: Sunbing --- drivers/staging/ks7010/michael_mic.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/staging/ks7010/michael_mic.c b/drivers/staging/ks7010/michael_mic.c index e14c109..ad4f779 100644 --- a/drivers/staging/ks7010/michael_mic.c +++ b/drivers/staging/ks7010/michael_mic.c @@ -20,15 +20,21 @@ #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) -- 2.1.0