Re: [PATCH RFC 2/2] wcslen() prototype in string.h

From: Andy Shevchenko
Date: Wed Mar 26 2025 - 05:00:09 EST


On Tue, Mar 25, 2025 at 05:33:03PM -0700, Nathan Chancellor wrote:
> On Tue, Mar 25, 2025 at 02:45:21PM -0700, Nathan Chancellor wrote:

...

> > +#include <linux/nls.h> /* for wchar_t */
>
> Good thing I waited :) This include makes s390 unhappy:
>
> https://lore.kernel.org/202503260611.MDurOUhF-lkp@xxxxxxxxx/
>
> It is possible that should be fixed by adding -Wno-pointer-sign to
> KBUILD_CFLAGS_DECOMPRESSOR so that arch/s390/boot matches the rest of
> the kernel but...

Ah, yes, you beat me up to commenting on this, the string.h and string.c made
in a way that they may be and are used in early boot code, i.e. it must not be
dirtyfied with the kernel code.

...

> > #include <linux/errno.h>
> > #include <linux/limits.h>
> > #include <linux/linkage.h>
> > +#include <linux/nls.h>
> > #include <linux/stddef.h>
> > #include <linux/string.h>
> > #include <linux/types.h>
>
> I wonder if would be better to do something like the below patch in lieu
> of the EFI change above (since there is no chance for a collision) then
> change both of the includes for wchar_t in this diff to nls_types.h? I
> have no strong opinion but this seems like it would be cleaner for the
> sake of backports while not being a bad solution upstream?

> #define _LINUX_NLS_H
>
> #include <linux/init.h>

As I just replied to your previous mail, consider fixing this list as well
by adding module.h and types.h.

...

Overall, can you browse the Ingo's series [1] for the stuff related to this,
if any?

I would avoid doing double efforts or different approaches if we already have
something ready.

[1]: https://lore.kernel.org/linux-kernel/YjBr10JXLGHfEFfi@xxxxxxxxx/

--
With Best Regards,
Andy Shevchenko