* [PATCH] Enclose multiple statements macros in a do while loop
@ 2016-07-14 9:01 Sunbing
2016-07-15 0:32 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Sunbing @ 2016-07-14 9:01 UTC (permalink / raw)
To: gregkh, wsa+renesas, devel, linux-kernel; +Cc: Sunbing, Sunbing
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 <sunbing.linux@gmail.com>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Enclose multiple statements macros in a do while loop
2016-07-14 9:01 [PATCH] Enclose multiple statements macros in a do while loop Sunbing
@ 2016-07-15 0:32 ` Greg KH
2016-07-17 16:13 ` sunbing
0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2016-07-15 0:32 UTC (permalink / raw)
To: Sunbing; +Cc: wsa+renesas, devel, linux-kernel, Sunbing
On Thu, Jul 14, 2016 at 05:01:51PM +0800, Sunbing wrote:
> 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 <sunbing.linux@gmail.com>
We need a "real" and "full" name here, please.
Also, work on your subject: line to match other patches that have been
accepted into this driver.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Enclose multiple statements macros in a do while loop
2016-07-15 0:32 ` Greg KH
@ 2016-07-17 16:13 ` sunbing
0 siblings, 0 replies; 3+ messages in thread
From: sunbing @ 2016-07-17 16:13 UTC (permalink / raw)
To: Greg KH; +Cc: wsa+renesas, devel, linux-kernel, Sunbing
On Jul 15, 2016, at 8:32, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Thu, Jul 14, 2016 at 05:01:51PM +0800, Sunbing wrote:
>> 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 <sunbing.linux@gmail.com>
>
> We need a "real" and "full" name here, please.
>
> Also, work on your subject: line to match other patches that have been
> accepted into this driver.
>
> thanks,
>
> greg k-h
Thanks for your reply.
1. I will change a real full subject name :
staging: ks7010: Change macros definition coding style in michael_mic.c
2. Do you mean a patch fix macros definition error was accepted ?
where can I find it ? I can’t find it in git and mail-list.
Regards.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-07-17 16:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-14 9:01 [PATCH] Enclose multiple statements macros in a do while loop Sunbing
2016-07-15 0:32 ` Greg KH
2016-07-17 16:13 ` sunbing
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.