Linux cryptographic layer development
 help / color / mirror / Atom feed
* [PATCH] lib/crypto: md5: correct header inclusions
@ 2026-10-15  3:38 Mohamad Raizudeen
  2026-10-15  4:47 ` Herbert Xu
  0 siblings, 1 reply; 3+ messages in thread
From: Mohamad Raizudeen @ 2026-10-15  3:38 UTC (permalink / raw)
  To: ebiggers, ardb
  Cc: Jason, skhan, me, jkoolstra, linux-crypto, linux-kernel,
	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>`.

Signed-off-by: Mohamad Raizudeen <raizudeen.kerneldev@gmail.com>
---
 lib/crypto/md5.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/crypto/md5.c b/lib/crypto/md5.c
index 3d2b017a0525..a838bb90103f 100644
--- a/lib/crypto/md5.c
+++ b/lib/crypto/md5.c
@@ -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 = {
-- 
2.53.0


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

* Re: [PATCH] lib/crypto: md5: correct header inclusions
  2026-10-15  3:38 [PATCH] lib/crypto: md5: correct header inclusions Mohamad Raizudeen
@ 2026-10-15  4:47 ` Herbert Xu
  2026-10-15  5:18   ` Mohamad Raizudeen
  0 siblings, 1 reply; 3+ messages in thread
From: Herbert Xu @ 2026-10-15  4:47 UTC (permalink / raw)
  To: Mohamad Raizudeen
  Cc: ebiggers, ardb, Jason, skhan, me, jkoolstra, linux-crypto,
	linux-kernel, raizudeen.kerneldev

Mohamad Raizudeen <raizudeen.kerneldev@gmail.com> wrote:
> 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>`.
> 
> Signed-off-by: Mohamad Raizudeen <raizudeen.kerneldev@gmail.com>
> ---
> lib/crypto/md5.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/crypto/md5.c b/lib/crypto/md5.c
> index 3d2b017a0525..a838bb90103f 100644
> --- a/lib/crypto/md5.c
> +++ b/lib/crypto/md5.c
> @@ -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,
-- 
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] 3+ messages in thread

* Re: [PATCH] lib/crypto: md5: correct header inclusions
  2026-10-15  4:47 ` Herbert Xu
@ 2026-10-15  5:18   ` Mohamad Raizudeen
  0 siblings, 0 replies; 3+ messages in thread
From: Mohamad Raizudeen @ 2026-10-15  5:18 UTC (permalink / raw)
  To: Herbert Xu
  Cc: ebiggers, ardb, Jason, skhan, me, jkoolstra, linux-crypto,
	linux-kernel

On Thu, Oct 15, 2026 at 03:47:43PM +1100, Herbert Xu wrote:
> Mohamad Raizudeen <raizudeen.kerneldev@gmail.com> wrote:
> > 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>`.
> > 
> > Signed-off-by: Mohamad Raizudeen <raizudeen.kerneldev@gmail.com>
> > ---
> > lib/crypto/md5.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/lib/crypto/md5.c b/lib/crypto/md5.c
> > index 3d2b017a0525..a838bb90103f 100644
> > --- a/lib/crypto/md5.c
> > +++ b/lib/crypto/md5.c
> > @@ -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,
> -- 
> 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

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

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

end of thread, other threads:[~2026-10-15  5:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-15  3:38 [PATCH] lib/crypto: md5: correct header inclusions Mohamad Raizudeen
2026-10-15  4:47 ` Herbert Xu
2026-10-15  5:18   ` Mohamad Raizudeen

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