All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: skein: Fixed Conditional white space problems
@ 2014-09-28 22:08 Eric Rost
  2014-09-28 22:14 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Rost @ 2014-09-28 22:08 UTC (permalink / raw)
  To: gregkh, jason, jake, antonysaraev; +Cc: devel, linux-kernel

This patch fixes the following checkpatch.pl Warnings:

WARNING: suspect code indent for conditional statements (16, 16)
+               for (r = 1; r < 2 * RCNT; r += 2 * SKEIN_UNROLL_512)
[...]
+               {

WARNING: suspect code indent for conditional statements (16, 16)
+               for (r = 1; r <= 2 * RCNT; r += 2 * SKEIN_UNROLL_1024)
[...]
+               {

Signed-off-by: Eric Rost <eric.rost@mybabylon.net>
---
 drivers/staging/skein/skein_block.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/skein/skein_block.c b/drivers/staging/skein/skein_block.c
index 616364f..bbb5a5b 100644
--- a/drivers/staging/skein/skein_block.c
+++ b/drivers/staging/skein/skein_block.c
@@ -380,7 +380,7 @@ do { \
 
 		for (r = 1; r < 2 * RCNT; r += 2 * SKEIN_UNROLL_512)
 #endif /* end of looped code definitions */
-		{
+			{
 #define R512_8_ROUNDS(R)  /* do 8 full rounds */  \
 do { \
 		R512(0, 1, 2, 3, 4, 5, 6, 7, R_512_0, 8 * (R) + 1);   \
@@ -447,7 +447,7 @@ do { \
 	#if  (SKEIN_UNROLL_512 > 14)
 #error  "need more unrolling in skein_512_process_block"
 	#endif
-		}
+			}
 
 		/* do the final "feedforward" xor, update context chaining */
 		ctx->x[0] = X0 ^ w[0];
@@ -659,7 +659,7 @@ do { \
 
 		for (r = 1; r <= 2 * RCNT; r += 2 * SKEIN_UNROLL_1024)
 #endif
-		{
+			{
 #define R1024_8_ROUNDS(R) \
 do { \
 	R1024(00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, 13, 14, 15, \
@@ -734,7 +734,7 @@ do { \
 #if  (SKEIN_UNROLL_1024 > 14)
 #error  "need more unrolling in Skein_1024_Process_Block"
   #endif
-		}
+			}
 		/* do the final "feedforward" xor, update context chaining */
 
 		ctx->x[0] = X00 ^ w[0];
-- 
1.7.10.4


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

* Re: [PATCH] staging: skein: Fixed Conditional white space problems
  2014-09-28 22:08 [PATCH] staging: skein: Fixed Conditional white space problems Eric Rost
@ 2014-09-28 22:14 ` Greg KH
  2014-09-28 23:02   ` Jason Cooper
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2014-09-28 22:14 UTC (permalink / raw)
  To: Eric Rost; +Cc: jason, jake, antonysaraev, devel, linux-kernel

On Sun, Sep 28, 2014 at 05:08:28PM -0500, Eric Rost wrote:
> This patch fixes the following checkpatch.pl Warnings:
> 
> WARNING: suspect code indent for conditional statements (16, 16)
> +               for (r = 1; r < 2 * RCNT; r += 2 * SKEIN_UNROLL_512)
> [...]
> +               {
> 
> WARNING: suspect code indent for conditional statements (16, 16)
> +               for (r = 1; r <= 2 * RCNT; r += 2 * SKEIN_UNROLL_1024)
> [...]
> +               {
> 
> Signed-off-by: Eric Rost <eric.rost@mybabylon.net>
> ---
>  drivers/staging/skein/skein_block.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/skein/skein_block.c b/drivers/staging/skein/skein_block.c
> index 616364f..bbb5a5b 100644
> --- a/drivers/staging/skein/skein_block.c
> +++ b/drivers/staging/skein/skein_block.c
> @@ -380,7 +380,7 @@ do { \
>  
>  		for (r = 1; r < 2 * RCNT; r += 2 * SKEIN_UNROLL_512)
>  #endif /* end of looped code definitions */
> -		{
> +			{

I'm glad you are trying to fix things, but in looking at this closer,
does it look correct to you?

>  #define R512_8_ROUNDS(R)  /* do 8 full rounds */  \
>  do { \
>  		R512(0, 1, 2, 3, 4, 5, 6, 7, R_512_0, 8 * (R) + 1);   \
> @@ -447,7 +447,7 @@ do { \
>  	#if  (SKEIN_UNROLL_512 > 14)
>  #error  "need more unrolling in skein_512_process_block"
>  	#endif
> -		}
> +			}

same here?

How about working on getting rid of the #if crap in this driver, that
will fix up this { } mess automatically.

thanks,

greg k-h

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

* Re: [PATCH] staging: skein: Fixed Conditional white space problems
  2014-09-28 22:14 ` Greg KH
@ 2014-09-28 23:02   ` Jason Cooper
  2014-09-30  0:40     ` Eric Rost
  0 siblings, 1 reply; 5+ messages in thread
From: Jason Cooper @ 2014-09-28 23:02 UTC (permalink / raw)
  To: Greg KH; +Cc: Eric Rost, jake, antonysaraev, devel, linux-kernel

On Sun, Sep 28, 2014 at 06:14:45PM -0400, Greg KH wrote:
> How about working on getting rid of the #if crap in this driver, that
> will fix up this { } mess automatically.

Yes, I commented on that earlier, it's a rather big job and may not be
appropriate for a beginner.

Eric, if you'd like to tackle it, be aware that it's most likely going
to be a series of changes, and I'll be looking to see that no object
code has changed (./scripts/objdiff) across your patch series.

thx,

Jason.

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

* Re: [PATCH] staging: skein: Fixed Conditional white space problems
  2014-09-28 23:02   ` Jason Cooper
@ 2014-09-30  0:40     ` Eric Rost
  2014-09-30  1:00       ` Jason Cooper
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Rost @ 2014-09-30  0:40 UTC (permalink / raw)
  To: Jason Cooper; +Cc: Greg KH, jake, antonysaraev, devel, linux-kernel

> >I'll be looking to see that no object
> code has changed (./scripts/objdiff) across your patch series.

Hmm... I'm thinking of digging into it, but I'm not sure the #if's can
be gotten rid of sans object code changes, since its picking codeblocks
in the precompiler stage, right?


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

* Re: [PATCH] staging: skein: Fixed Conditional white space problems
  2014-09-30  0:40     ` Eric Rost
@ 2014-09-30  1:00       ` Jason Cooper
  0 siblings, 0 replies; 5+ messages in thread
From: Jason Cooper @ 2014-09-30  1:00 UTC (permalink / raw)
  To: Eric Rost; +Cc: Greg KH, jake, antonysaraev, devel, linux-kernel

Eric,

On Mon, Sep 29, 2014 at 07:40:11PM -0500, Eric Rost wrote:
> > >I'll be looking to see that no object
> > code has changed (./scripts/objdiff) across your patch series.
> 
> Hmm... I'm thinking of digging into it, but I'm not sure the #if's can
> be gotten rid of sans object code changes, since its picking codeblocks
> in the precompiler stage, right?

You just have to remain consistent with what's currently being selected.
But yes, you are correct.

And don't get yourself too tied up in knots wrt objdiff-perfection.  I
would take a look at what Joe Perches posted as a starting point.  I
haven't reviewed it in depth yet as I'm wrapped around the axle with
other commitments.

If you get stuck, just ask.  A *little* beating your head against the
wall is part of the learning process, a lot is just unnecessary
frustration.

wrt to this code, we don't necessarily need to see the macros and such
removed.  First step, get them out of the middle of functions.  Second
step, decide which would be better off as static inline functions.  The
rest may be able to go into a common include.

thx,

Jason.

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

end of thread, other threads:[~2014-09-30  1:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-28 22:08 [PATCH] staging: skein: Fixed Conditional white space problems Eric Rost
2014-09-28 22:14 ` Greg KH
2014-09-28 23:02   ` Jason Cooper
2014-09-30  0:40     ` Eric Rost
2014-09-30  1:00       ` Jason Cooper

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.