public inbox for linux-crypto@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crypto: aes_generic: fixed styling warnings
@ 2022-03-26 17:20 Paul Lemmermann
  2022-03-27 11:41 ` Ard Biesheuvel
  2022-04-11 10:34 ` [crypto] 8505b026c9: hwsim.fils_sk_hlp_oom.fail kernel test robot
  0 siblings, 2 replies; 6+ messages in thread
From: Paul Lemmermann @ 2022-03-26 17:20 UTC (permalink / raw)
  To: davem; +Cc: linux-crypto, linux-kernel, Paul Lemmermann

Fixed all styling warnings from the checkpatch.pl script.

Signed-off-by: Paul Lemmermann <thepaulodoom@thepaulodoom.com>
---
 crypto/aes_generic.c | 35 ++++++++++++++++++-----------------
 1 file changed, 18 insertions(+), 17 deletions(-)

diff --git a/crypto/aes_generic.c b/crypto/aes_generic.c
index 27ab27931..322e345ac 100644
--- a/crypto/aes_generic.c
+++ b/crypto/aes_generic.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Cryptographic API.
  *
@@ -56,7 +57,7 @@
 #include <asm/byteorder.h>
 #include <asm/unaligned.h>
 
-static inline u8 byte(const u32 x, const unsigned n)
+static inline u8 byte(const u32 x, const unsigned int n)
 {
 	return x >> (n << 3);
 }
@@ -325,6 +326,7 @@ __visible const u32 crypto_ft_tab[4][256] ____cacheline_aligned = {
 		0x7bcbb0b0, 0xa8fc5454, 0x6dd6bbbb, 0x2c3a1616,
 	}
 };
+EXPORT_SYMBOL_GPL(crypto_ft_tab);
 
 static const u32 crypto_fl_tab[4][256] ____cacheline_aligned = {
 	{
@@ -853,6 +855,7 @@ __visible const u32 crypto_it_tab[4][256] ____cacheline_aligned = {
 		0x7b6184cb, 0xd570b632, 0x48745c6c, 0xd04257b8,
 	}
 };
+EXPORT_SYMBOL_GPL(crypto_it_tab);
 
 static const u32 crypto_il_tab[4][256] ____cacheline_aligned = {
 	{
@@ -1118,8 +1121,6 @@ static const u32 crypto_il_tab[4][256] ____cacheline_aligned = {
 	}
 };
 
-EXPORT_SYMBOL_GPL(crypto_ft_tab);
-EXPORT_SYMBOL_GPL(crypto_it_tab);
 
 /**
  * crypto_aes_set_key - Set the AES key.
@@ -1144,34 +1145,34 @@ EXPORT_SYMBOL_GPL(crypto_aes_set_key);
 
 /* encrypt a block of text */
 
-#define f_rn(bo, bi, n, k)	do {				\
+#define f_rn(bo, bi, n, k)	while (0) {				\
 	bo[n] = crypto_ft_tab[0][byte(bi[n], 0)] ^			\
 		crypto_ft_tab[1][byte(bi[(n + 1) & 3], 1)] ^		\
 		crypto_ft_tab[2][byte(bi[(n + 2) & 3], 2)] ^		\
 		crypto_ft_tab[3][byte(bi[(n + 3) & 3], 3)] ^ *(k + n);	\
-} while (0)
+}
 
-#define f_nround(bo, bi, k)	do {\
+#define f_nround(bo, bi, k)	while (0) {\
 	f_rn(bo, bi, 0, k);	\
 	f_rn(bo, bi, 1, k);	\
 	f_rn(bo, bi, 2, k);	\
 	f_rn(bo, bi, 3, k);	\
 	k += 4;			\
-} while (0)
+}
 
-#define f_rl(bo, bi, n, k)	do {				\
+#define f_rl(bo, bi, n, k)	while (0) {				\
 	bo[n] = crypto_fl_tab[0][byte(bi[n], 0)] ^			\
 		crypto_fl_tab[1][byte(bi[(n + 1) & 3], 1)] ^		\
 		crypto_fl_tab[2][byte(bi[(n + 2) & 3], 2)] ^		\
 		crypto_fl_tab[3][byte(bi[(n + 3) & 3], 3)] ^ *(k + n);	\
-} while (0)
+}
 
-#define f_lround(bo, bi, k)	do {\
+#define f_lround(bo, bi, k)	while (0) {\
 	f_rl(bo, bi, 0, k);	\
 	f_rl(bo, bi, 1, k);	\
 	f_rl(bo, bi, 2, k);	\
 	f_rl(bo, bi, 3, k);	\
-} while (0)
+}
 
 static void crypto_aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
 {
@@ -1214,12 +1215,12 @@ static void crypto_aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
 
 /* decrypt a block of text */
 
-#define i_rn(bo, bi, n, k)	do {				\
+#define i_rn(bo, bi, n, k)	while (0) {				\
 	bo[n] = crypto_it_tab[0][byte(bi[n], 0)] ^			\
 		crypto_it_tab[1][byte(bi[(n + 3) & 3], 1)] ^		\
 		crypto_it_tab[2][byte(bi[(n + 2) & 3], 2)] ^		\
 		crypto_it_tab[3][byte(bi[(n + 1) & 3], 3)] ^ *(k + n);	\
-} while (0)
+}
 
 #define i_nround(bo, bi, k)	do {\
 	i_rn(bo, bi, 0, k);	\
@@ -1229,19 +1230,19 @@ static void crypto_aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
 	k += 4;			\
 } while (0)
 
-#define i_rl(bo, bi, n, k)	do {			\
+#define i_rl(bo, bi, n, k)	while (0) {			\
 	bo[n] = crypto_il_tab[0][byte(bi[n], 0)] ^		\
 	crypto_il_tab[1][byte(bi[(n + 3) & 3], 1)] ^		\
 	crypto_il_tab[2][byte(bi[(n + 2) & 3], 2)] ^		\
 	crypto_il_tab[3][byte(bi[(n + 1) & 3], 3)] ^ *(k + n);	\
-} while (0)
+}
 
-#define i_lround(bo, bi, k)	do {\
+#define i_lround(bo, bi, k)	while (0) {\
 	i_rl(bo, bi, 0, k);	\
 	i_rl(bo, bi, 1, k);	\
 	i_rl(bo, bi, 2, k);	\
 	i_rl(bo, bi, 3, k);	\
-} while (0)
+}
 
 static void crypto_aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
 {
-- 
2.35.1


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

end of thread, other threads:[~2022-04-12 23:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-26 17:20 [PATCH] crypto: aes_generic: fixed styling warnings Paul Lemmermann
2022-03-27 11:41 ` Ard Biesheuvel
     [not found]   ` <20220327224009.2jotnczk67j4cfh2@hp-amd-paul>
2022-03-28  7:39     ` Ard Biesheuvel
2022-03-28 12:51       ` Paul Lemmermann
2022-04-11 10:34 ` [crypto] 8505b026c9: hwsim.fils_sk_hlp_oom.fail kernel test robot
2022-04-12 20:36   ` Paul Lemmermann

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