diff mbox series

crypto: md4: Fix checkpatch issues

Message ID 20230606112610.98149-1-franziska.naepelt@gmail.com
State New
Headers show
Series crypto: md4: Fix checkpatch issues | expand

Commit Message

Franziska Näpelt June 6, 2023, 11:26 a.m. UTC
The following checkpatch issues have been fixed:
- WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
- ERROR: space required after that ',' (ctx:VxV)
- ERROR: space prohibited after that open square bracket '['
- WARNING: space prohibited between function name and open parenthesis '('
- ERROR: code indent should use tabs where possible

not fixed:
- ERROR: space required after that ',' (ctx:VxV)
in lines: 64, 65, 66 have not ben fixed due to readability

Signed-off-by: Franziska Naepelt <franziska.naepelt@gmail.com>
---
 crypto/md4.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)


base-commit: 9561de3a55bed6bdd44a12820ba81ec416e705a7
--
2.39.2 (Apple Git-143)

Comments

Bagas Sanjaya June 6, 2023, 12:14 p.m. UTC | #1
On Tue, Jun 06, 2023 at 01:26:10PM +0200, Franziska Naepelt wrote:
> The following checkpatch issues have been fixed:
> - WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
> - ERROR: space required after that ',' (ctx:VxV)
> - ERROR: space prohibited after that open square bracket '['
> - WARNING: space prohibited between function name and open parenthesis '('
> - ERROR: code indent should use tabs where possible

Again, please split up into one patch per fixes, as a patch series.

> 
> not fixed:
> - ERROR: space required after that ',' (ctx:VxV)
> in lines: 64, 65, 66 have not ben fixed due to readability

Can you clearly explain why do you skip #define ROUNDx macros?

> -/* 
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/*
>   * Cryptographic API.
>   *
>   * MD4 Message Digest Algorithm (RFC1320).

What about removing the license boilerplate text below (and thus convert
to SPDX)? Personally, I prefer having a SPDX conversion series for crypto/
directory instead.

Thanks.
Bagas Sanjaya June 6, 2023, 12:22 p.m. UTC | #2
On 6/6/23 19:18, Ard Biesheuvel wrote:
> On Tue, 6 Jun 2023 at 14:15, Bagas Sanjaya <bagasdotme@gmail.com> wrote:
>>
>> On Tue, Jun 06, 2023 at 01:26:10PM +0200, Franziska Naepelt wrote:
>>> The following checkpatch issues have been fixed:
>>> - WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
>>> - ERROR: space required after that ',' (ctx:VxV)
>>> - ERROR: space prohibited after that open square bracket '['
>>> - WARNING: space prohibited between function name and open parenthesis '('
>>> - ERROR: code indent should use tabs where possible
>>
>> Again, please split up into one patch per fixes, as a patch series.
>>
> 
> Apart from the SPDX conversion, I think it is fine to fix multiple
> different whitespace issues in the same file with one patch. Splitting
> that up is just busywork.
> 

Do you mean SPDX conversion in one patch and the rest in another? I think
so and confused...
diff mbox series

Patch

diff --git a/crypto/md4.c b/crypto/md4.c
index 2e7f2f319f95..4083698c242c 100644
--- a/crypto/md4.c
+++ b/crypto/md4.c
@@ -1,4 +1,5 @@ 
-/* 
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
  * Cryptographic API.
  *
  * MD4 Message Digest Algorithm (RFC1320).
@@ -90,7 +91,7 @@  static void md4_transform(u32 *hash, u32 const *in)
 	ROUND1(c, d, a, b, in[14], 11);
 	ROUND1(b, c, d, a, in[15], 19);

-	ROUND2(a, b, c, d,in[ 0], 3);
+	ROUND2(a, b, c, d, in[0], 3);
 	ROUND2(d, a, b, c, in[4], 5);
 	ROUND2(c, d, a, b, in[8], 9);
 	ROUND2(b, c, d, a, in[12], 13);
@@ -107,7 +108,7 @@  static void md4_transform(u32 *hash, u32 const *in)
 	ROUND2(c, d, a, b, in[11], 9);
 	ROUND2(b, c, d, a, in[15], 13);

-	ROUND3(a, b, c, d,in[ 0], 3);
+	ROUND3(a, b, c, d, in[0], 3);
 	ROUND3(d, a, b, c, in[8], 9);
 	ROUND3(c, d, a, b, in[4], 11);
 	ROUND3(b, c, d, a, in[12], 15);
@@ -190,7 +191,7 @@  static int md4_final(struct shash_desc *desc, u8 *out)

 	*p++ = 0x80;
 	if (padding < 0) {
-		memset(p, 0x00, padding + sizeof (u64));
+		memset(p, 0x00, padding + sizeof(u64));
 		md4_transform_helper(mctx);
 		p = (char *)mctx->block;
 		padding = 56;
@@ -200,7 +201,7 @@  static int md4_final(struct shash_desc *desc, u8 *out)
 	mctx->block[14] = mctx->byte_count << 3;
 	mctx->block[15] = mctx->byte_count >> 29;
 	le32_to_cpu_array(mctx->block, (sizeof(mctx->block) -
-	                  sizeof(u64)) / sizeof(u32));
+			  sizeof(u64)) / sizeof(u32));
 	md4_transform(mctx->hash, mctx->block);
 	cpu_to_le32_array(mctx->hash, ARRAY_SIZE(mctx->hash));
 	memcpy(out, mctx->hash, sizeof(mctx->hash));