Re: [PATCH] lib/crypto: md5: correct header inclusions
From: Mohamad Raizudeen
Date: Thu Oct 15 2026 - 01:18:51 EST
On Thu, Oct 15, 2026 at 03:47:43PM +1100, Herbert Xu wrote:
> Mohamad Raizudeen <raizudeen.kerneldev@xxxxxxxxx> 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@xxxxxxxxx>
> > ---
> > 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@xxxxxxxxxxxxxxxxxxx>
> 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