Re: [PATCH v1 1/1] bitops: Move aligned_byte_mask() to wordpart.h

From: Andy Shevchenko
Date: Tue May 07 2024 - 15:36:11 EST


On Tue, May 07, 2024 at 12:14:58PM -0700, Yury Norov wrote:
> On Tue, May 07, 2024 at 05:01:54PM +0300, Andy Shevchenko wrote:
> > The bitops.h is for bit related operations. The aligned_byte_mask()
> > is about byte (or part of the machine word) operations, for which
> > we have a separate header, move the mentioned macro to wordpart.h
> > to consolidate similar operations.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
>
> Hi Andy,
>
> I see the macro is used in lib/strnlen_user.c and in lib/usercopy.c.
> In case of strnlen_user, the wordpart.h is included via linux/kernel.h,
> which is OK to me. But In case of usercopy.c, I can't find how the
> header is included.
>
> I'm sure there is some inclusion path, but it's always better to have
> the dependencies listed explicitly.
>
> Can you please send a 2nd version with the lib/usercopy.c including
> wordpart.h?

I think it's unrelated right now. The inclusions in usercopy is a mess.
It should be cleaned up in a separate patch for all inclusions.

But okay, making slightly more mess there won't harm :-)

--
With Best Regards,
Andy Shevchenko