Skip to contentSkip to conversation

lib/crypto: md5: correct header inclusions

PATCH In review Mohamad Raizudeen 2 participants 3 messages Oct 15

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/crypto: md5: correct header inclusions

The file uses 'rol32()' inline function (inside the MD5STEP macro) but does not explicitly include <linux/bitops.h>, currently relying on indirect includes.

Also, <linux/unaligned.h> is included but never used, as the code relies on direct pointer casts.

Add the missing <linux/bitops.h> and remove the unused <linux/unaligned.h>.

---
 lib/crypto/md5.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/crypto/md5.c +1 -1
index 3d2b017a0525..a838bb90103f 100644
@@ -13,10 +13,10 @@
 #include <crypto/hmac.h>
 #include <crypto/md5.h>
 #include <linux/export.h>
+#include <linux/bitops.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/string.h>
-#include <linux/unaligned.h>
 #include <linux/wordpart.h>
 
 static const struct md5_block_state md5_iv = {
Signature · 1 line
2.53.0
maintainer
#1 lore raw
Quoted 20 lines · Mohamad Raizudeen

The file uses 'rol32()' inline function (inside the MD5STEP macro) but does not explicitly include <linux/bitops.h>, currently relying on indirect includes.

Also, <linux/unaligned.h> is included but never used, as the code relies on direct pointer casts.

Add the missing <linux/bitops.h> and remove the unused <linux/unaligned.h>.

---
lib/crypto/md5.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
lib/crypto/md5.c +0 -0
index 3d2b017a0525..a838bb90103f 100644

lib/crypto/md5.c line 17

Quoted 5 lines
lib/crypto/md5.c +1 -0
@@ -13,10 +13,10 @@
 #include <crypto/hmac.h>
 #include <crypto/md5.h>
 #include <linux/export.h>
+#include <linux/bitops.h>
 #include <linux/kernel.h>

bitops.h is redundant because kernel.h already includes it.

Cheers,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
#2 lore raw
Quoted 29 lines · Herbert Xu
Quoted 20 lines · Mohamad Raizudeen

The file uses 'rol32()' inline function (inside the MD5STEP macro) but does not explicitly include <linux/bitops.h>, currently relying on indirect includes.

Also, <linux/unaligned.h> is included but never used, as the code relies on direct pointer casts.

Add the missing <linux/bitops.h> and remove the unused <linux/unaligned.h>.

---
lib/crypto/md5.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
lib/crypto/md5.c +0 -0
index 3d2b017a0525..a838bb90103f 100644

lib/crypto/md5.c line 17

Quoted 5 lines
lib/crypto/md5.c +1 -0
@@ -13,10 +13,10 @@
 #include <crypto/hmac.h>
 #include <crypto/md5.h>
 #include <linux/export.h>
+#include <linux/bitops.h>
 #include <linux/kernel.h>

bitops.h is redundant because kernel.h already includes it.

Quoted 5 lines

Cheers,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Understood. I will drop the bitops.h addition. I will send a v2 that only removes the unused <linux/unaligned.h> include.

Thanks,
Mohamad Raizudeen