Re: [PATCH/RFC 2/2] lib: string: Make all calls to strnicmp into calls to strncasecmp

From: Rasmus Villemoes
Date: Wed Aug 27 2014 - 05:13:26 EST


On Wed, Aug 27 2014, Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:

> On Wed, Aug 27, 2014 at 09:36:02AM +0200, Rasmus Villemoes wrote:
>> The previous patch made strnicmp into a wrapper for strncasecmp. This
>> patch makes all in-tree users of strnicmp call strncasecmp directly,
>> while still making sure that the strnicmp symbol can be used by
>> out-of-tree modules. It should be considered a temporary hack until
>> all in-tree callers have been converted.
>>
>> Signed-off-by: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx>
>
> Won't GCC just do the right thing without this second patch?
>

Not without LTO, I think. gcc can't really know how strnicmp is
implemented, so it has to emit a call to it.

Anyway, I was also planning on sending tree-wide patches doing
s/strnicmp/strncasecmp/, and then removing the hack from string.h, but I
first wanted to get feedback on the first patch and maybe some guidance
on how to properly deal with the module issue (e.g., does the kernel
need to export a strnicmp symbol forever?).

Rasmus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/