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

From: Lucas De Marchi
Date: Tue Oct 05 2021 - 19:33:44 EST


On Tue, Oct 05, 2021 at 04:21:21PM -0700, Andrew Morton wrote:
On Tue, 5 Oct 2021 14:26:34 -0700 Lucas De Marchi <lucas.demarchi@xxxxxxxxx> wrote:

linux/string_helpers.h uses strlen(), so include the correpondent
header. Otherwise we get a compilation error if it's not also included
by whoever included the helper.

Is such a compilation error demonstrable in the current mainline kernel?

No, not with the current mainline. I was just starting to implement some
more helpers there and noticed the issue when including this header from
i915. Then I noticed Andy and Jani already had similar patches to what
I was doing:

https://lore.kernel.org/all/20210215142137.64476-1-andriy.shevchenko@xxxxxxxxxxxxxxx/
and https://lore.kernel.org/all/20191023131308.9420-1-jani.nikula@xxxxxxxxx/

So I'm following up on the first thread abovee to figure out what would
be the proper header to implement this. Meanwhile, we can have this
quick harmless fix.

thanks,
Lucas De Marchi