2011-04-07 06:49:56

by Aditya Shevade

[permalink] [raw]
Subject: [PATCH] crypto: blowfish: Fixed a multi line macro issue

Fixed a multi line macro with do-while loop.
Fixed some other minor tab related issues.

Signed-off-by: Aditya Shevade <[email protected]>
---
crypto/blowfish.c | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/crypto/blowfish.c b/crypto/blowfish.c
index a67d52e..5d9bc2e 100644
--- a/crypto/blowfish.c
+++ b/crypto/blowfish.c
@@ -309,9 +309,13 @@ static const u32 bf_sbox[256 * 4] = {
#define GET32_0(x) (((x) >> (24)) & (0xff))

#define bf_F(x) (((S[GET32_0(x)] + S[256 + GET32_1(x)]) ^ \
- S[512 + GET32_2(x)]) + S[768 + GET32_3(x)])
+ S[512 + GET32_2(x)]) + S[768 + GET32_3(x)])

-#define ROUND(a, b, n) b ^= P[n]; a ^= bf_F (b)
+#define ROUND(a, b, n) \
+ do { \
+ b ^= P[n]; \
+ a ^= bf_F(b) \
+ } while (0)

/*
* The blowfish encipher, processes 64-bit blocks.
@@ -460,9 +464,9 @@ static struct crypto_alg alg = {
.cra_u = { .cipher = {
.cia_min_keysize = BF_MIN_KEY_SIZE,
.cia_max_keysize = BF_MAX_KEY_SIZE,
- .cia_setkey = bf_setkey,
- .cia_encrypt = bf_encrypt,
- .cia_decrypt = bf_decrypt } }
+ .cia_setkey = bf_setkey,
+ .cia_encrypt = bf_encrypt,
+ .cia_decrypt = bf_decrypt } }
};

static int __init blowfish_mod_init(void)
--
1.7.4.3


2011-04-08 12:45:08

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH] crypto: blowfish: Fixed a multi line macro issue

On Wed, Apr 06, 2011 at 11:49:20PM -0700, Aditya Shevade wrote:
> Fixed a multi line macro with do-while loop.
> Fixed some other minor tab related issues.
>
> Signed-off-by: Aditya Shevade <[email protected]>

Your patch doesn't even build!
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

2011-04-08 17:46:57

by Aditya Shevade

[permalink] [raw]
Subject: Re: [PATCH] crypto: blowfish: Fixed a multi line macro issue

On Fri, Apr 8, 2011 at 5:45 AM, Herbert Xu <[email protected]> wrote:
>
> On Wed, Apr 06, 2011 at 11:49:20PM -0700, Aditya Shevade wrote:
> > Fixed a multi line macro with do-while loop.
> > Fixed some other minor tab related issues.
> >
> > Signed-off-by: Aditya Shevade <[email protected]>
>
> Your patch doesn't even build!
> --
> Email: Herbert Xu <[email protected]>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Oh, I see the problem. I forgot a semicolon in the commit file. Making
the change.

2011-04-08 17:54:27

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] crypto: blowfish: Fixed a multi line macro issue

From: Aditya Shevade <[email protected]>
Date: Fri, 8 Apr 2011 10:46:57 -0700

> Oh, I see the problem. I forgot a semicolon in the commit file. Making
> the change.

I think it's even more important that you are submitting patches
you aren't even build testing.