mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] staging: skein: Fixing various coding style problems
@ 2014-12-22  0:09 mathieu.poirier
  2014-12-22  1:56 ` Greg KH
  2014-12-22  1:57 ` Jason Cooper
  0 siblings, 2 replies; 4+ messages in thread
From: mathieu.poirier @ 2014-12-22  0:09 UTC (permalink / raw)
  To: jason, gregkh; +Cc: devel, linux-kernel, mathieu.poirier

From: Mathieu Poirier <mathieu.poirier@linaro.org>

Fixing errors related to the usage of do {} while (0) loop
in single statement macros, trailing semicolon in macros and
trailing whitespace.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
---
 drivers/staging/skein/skein_block.c   | 17 ++++-------------
 drivers/staging/skein/skein_generic.c |  1 -
 2 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/skein/skein_block.c b/drivers/staging/skein/skein_block.c
index 66261ab25c88..43a342372633 100644
--- a/drivers/staging/skein/skein_block.c
+++ b/drivers/staging/skein/skein_block.c
@@ -82,10 +82,7 @@ do {                                                                      \
 } while (0)
 #else
 /* looping version */
-#define R256(p0, p1, p2, p3, ROT, r_num) \
-do { \
-	ROUND256(p0, p1, p2, p3, ROT, r_num); \
-} while (0)
+#define R256(p0, p1, p2, p3, ROT, r_num) ROUND256(p0, p1, p2, p3, ROT, r_num)
 
 #define I256(R) \
 do { \
@@ -174,9 +171,7 @@ do {                                                                      \
 
 #else /* looping version */
 #define R512(p0, p1, p2, p3, p4, p5, p6, p7, ROT, r_num)                 \
-do {                                                                     \
-	ROUND512(p0, p1, p2, p3, p4, p5, p6, p7, ROT, r_num);            \
-} while (0)
+	ROUND512(p0, p1, p2, p3, p4, p5, p6, p7, ROT, r_num)
 
 #define I512(R)                                                           \
 do {                                                                      \
@@ -263,10 +258,8 @@ do {                                                                          \
 #if SKEIN_UNROLL_1024 == 0
 #define R1024(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, pA, pB, pC, pD, pE, pF, \
 	      ROT, rn)                                                        \
-do {                                                                          \
 	ROUND1024(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, pA, pB, pC, pD, pE, \
-		  pF, ROT, rn);                                               \
-} while (0)
+		  pF, ROT, rn)
 
 #define I1024(R)                                                          \
 do {                                                                      \
@@ -291,10 +284,8 @@ do {                                                                      \
 #else /* looping version */
 #define R1024(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, pA, pB, pC, pD, pE, pF, \
 	      ROT, rn)                                                        \
-do {                                                                          \
 	ROUND1024(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, pA, pB, pC, pD, pE, \
-		  pF, ROT, rn);                                               \
-} while (0)
+		  pF, ROT, rn)
 
 #define I1024(R)                                                           \
 do {                                                                       \
diff --git a/drivers/staging/skein/skein_generic.c b/drivers/staging/skein/skein_generic.c
index 85bd7d0168b0..899078f1b8bc 100644
--- a/drivers/staging/skein/skein_generic.c
+++ b/drivers/staging/skein/skein_generic.c
@@ -191,7 +191,6 @@ static int __init skein_generic_init(void)
 
 	return 0;
 
-		
 unreg512:
 	crypto_unregister_shash(&alg512);
 unreg256:
-- 
1.9.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] staging: skein: Fixing various coding style problems
  2014-12-22  0:09 [PATCH] staging: skein: Fixing various coding style problems mathieu.poirier
@ 2014-12-22  1:56 ` Greg KH
  2014-12-22  1:57 ` Jason Cooper
  1 sibling, 0 replies; 4+ messages in thread
From: Greg KH @ 2014-12-22  1:56 UTC (permalink / raw)
  To: mathieu.poirier; +Cc: jason, devel, linux-kernel

On Sun, Dec 21, 2014 at 05:09:48PM -0700, mathieu.poirier@linaro.org wrote:
> From: Mathieu Poirier <mathieu.poirier@linaro.org>
> 
> Fixing errors related to the usage of do {} while (0) loop
> in single statement macros, trailing semicolon in macros and
> trailing whitespace.

That's a lot of things all at once, please break this up into individual
patches, each one only doing one thing.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] staging: skein: Fixing various coding style problems
  2014-12-22  0:09 [PATCH] staging: skein: Fixing various coding style problems mathieu.poirier
  2014-12-22  1:56 ` Greg KH
@ 2014-12-22  1:57 ` Jason Cooper
  2014-12-22  2:19   ` Mathieu Poirier
  1 sibling, 1 reply; 4+ messages in thread
From: Jason Cooper @ 2014-12-22  1:57 UTC (permalink / raw)
  To: mathieu.poirier; +Cc: gregkh, devel, linux-kernel

Mathieu,

On Sun, Dec 21, 2014 at 05:09:48PM -0700, mathieu.poirier@linaro.org wrote:
> From: Mathieu Poirier <mathieu.poirier@linaro.org>
> 
> Fixing errors related to the usage of do {} while (0) loop
> in single statement macros, trailing semicolon in macros and
> trailing whitespace.

Huh.  iirc, I added those do {} while(0)s to keep checkpatch happy.
Either it's gotten smarter, or something is off.

At any rate, the whole macro menagerie in here concerns me a bit and I'm
reluctant to change it until I have some time to refresh my memory on
what this code is doing.

It would be helpful if you could give scripts/objdiff a try on the
before and after effects of your patch.  If the object code doesn't
change, then we can be more confident that the patch is just style
changes.  Please also check when SKEIN_UNROLL_* is set/unset.

I really should put the patch series together to move this driver out of
staging.  Then maybe folks will stop running checkpatch against it :-)

thx,

Jason.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] staging: skein: Fixing various coding style problems
  2014-12-22  1:57 ` Jason Cooper
@ 2014-12-22  2:19   ` Mathieu Poirier
  0 siblings, 0 replies; 4+ messages in thread
From: Mathieu Poirier @ 2014-12-22  2:19 UTC (permalink / raw)
  To: Jason Cooper; +Cc: Greg KH, devel, linux-kernel

On 21 December 2014 at 18:57, Jason Cooper <jason@lakedaemon.net> wrote:
> Mathieu,
>
> On Sun, Dec 21, 2014 at 05:09:48PM -0700, mathieu.poirier@linaro.org wrote:
>> From: Mathieu Poirier <mathieu.poirier@linaro.org>
>>
>> Fixing errors related to the usage of do {} while (0) loop
>> in single statement macros, trailing semicolon in macros and
>> trailing whitespace.
>
> Huh.  iirc, I added those do {} while(0)s to keep checkpatch happy.
> Either it's gotten smarter, or something is off.

Checkpatch apparently changed it's mind.

>
> At any rate, the whole macro menagerie in here concerns me a bit and I'm
> reluctant to change it until I have some time to refresh my memory on
> what this code is doing.
>
> It would be helpful if you could give scripts/objdiff a try on the
> before and after effects of your patch.  If the object code doesn't
> change, then we can be more confident that the patch is just style
> changes.  Please also check when SKEIN_UNROLL_* is set/unset.

You got it.

>
> I really should put the patch series together to move this driver out of
> staging.  Then maybe folks will stop running checkpatch against it :-)
>
> thx,
>
> Jason.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-12-22  2:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-22  0:09 [PATCH] staging: skein: Fixing various coding style problems mathieu.poirier
2014-12-22  1:56 ` Greg KH
2014-12-22  1:57 ` Jason Cooper
2014-12-22  2:19   ` Mathieu Poirier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®