All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crypto: fcrypt: Remove 'do while(0)' loop for single statement macro
@ 2021-03-26 18:35 Milan Djurovic
  2021-04-02  9:48 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Milan Djurovic @ 2021-03-26 18:35 UTC (permalink / raw)
  To: herbert, davem; +Cc: linux-crypto, Milan Djurovic

Remove the 'do while(0)' loop in the macro, as it is not needed for single
statement macros. Condense into one line.

Signed-off-by: Milan Djurovic <mdjurovic@zohomail.com>
---
 crypto/fcrypt.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/crypto/fcrypt.c b/crypto/fcrypt.c
index c36ea0c8be98..76a04d000c0d 100644
--- a/crypto/fcrypt.c
+++ b/crypto/fcrypt.c
@@ -63,10 +63,7 @@ do {								\
 } while (0)
 
 /* Rotate right one 64 bit number as a 56 bit number */
-#define ror56_64(k, n)						\
-do {								\
-	k = (k >> n) | ((k & ((1 << n) - 1)) << (56 - n));	\
-} while (0)
+#define ror56_64(k, n) (k = (k >> n) | ((k & ((1 << n) - 1)) << (56 - n)))
 
 /*
  * Sboxes for Feistel network derived from
-- 
2.31.0


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

* Re: [PATCH] crypto: fcrypt: Remove 'do while(0)' loop for single statement macro
  2021-03-26 18:35 [PATCH] crypto: fcrypt: Remove 'do while(0)' loop for single statement macro Milan Djurovic
@ 2021-04-02  9:48 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2021-04-02  9:48 UTC (permalink / raw)
  To: Milan Djurovic; +Cc: davem, linux-crypto

On Fri, Mar 26, 2021 at 11:35:11AM -0700, Milan Djurovic wrote:
> Remove the 'do while(0)' loop in the macro, as it is not needed for single
> statement macros. Condense into one line.
> 
> Signed-off-by: Milan Djurovic <mdjurovic@zohomail.com>
> ---
>  crypto/fcrypt.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

end of thread, other threads:[~2021-04-02  9:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-26 18:35 [PATCH] crypto: fcrypt: Remove 'do while(0)' loop for single statement macro Milan Djurovic
2021-04-02  9:48 ` Herbert Xu

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.