Re: [PATCH] lib/string_helpers: add linux/string.h for strlen()

From: Andy Shevchenko
Date: Wed Oct 06 2021 - 03:14:54 EST


On Wed, Oct 6, 2021 at 9:30 AM Lucas De Marchi <lucas.demarchi@xxxxxxxxx> wrote:
> On Wed, Oct 06, 2021 at 08:57:27AM +0300, Andy Shevchenko wrote:
> >On Wednesday, October 6, 2021, Lucas De Marchi <lucas.demarchi@xxxxxxxxx>
> >wrote:
> >
> >> linux/string_helpers.h uses strlen(), so include the correspondent

correspondent

> >> header. Otherwise we get a compilation error if it's not also included
> >> by whoever included the helper.

...

> >I’m afraid this potentially can add into header dependencies hell. What
> >about moving the user to the C file?
>
> I can do that, but I don't see the problem here... afaics it has been like this
> for 7 years, since commit c8250381c827 ("lib / string_helpers: introduce string_escape_mem()"),
> and the only way it was never borken is because
> linux/string.h is already being indirectly included from other headers.

> So just adding it here is harmless.

Quite possible.

...

> Anyway, if it's preferable to move these functions out of line, I can do
> so.

I have no strong opinion, whatever maintainers will decide then!

--
With Best Regards,
Andy Shevchenko