Re: [PATCH] linux/string.h: Introduce streq macro.

From: Pavel Vasilyev
Date: Wed Apr 27 2011 - 05:12:52 EST


27.04.2011 12:49, Miguel Ojeda ÐÐÑÐÑ:
> On Wed, Apr 27, 2011 at 10:42 AM, Geert Uytterhoeven
> <geert@xxxxxxxxxxxxxx> wrote:
>> On Wed, Apr 27, 2011 at 10:29, Miguel Ojeda
>> <miguel.ojeda.sandonis@xxxxxxxxx> wrote:
>>> On Tue, Apr 26, 2011 at 9:58 PM, Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>>>> On Tue, 2011-04-26 at 16:47 -0300, Thiago Farina wrote:
>>>>
>>>>>> $ grep -rP --include=*.[ch] "\bstrcmp.*==\s*0\b" * | wc -l
>>>>>> 1143
>>>>>> $ grep -rP --include=*.[ch] "\!\s*strcmp\s*\(" * | wc -l
>>>>>> 1663
>>>>>>
>>>>>> Can you count how many misuses of strcmp have been
>>>>>> corrected?
>>>>>
>>>>>> Do you plan to convert the existing 2800?
>>>>>
>>>>> I'd work on this without any problem.
>>>>
>>>> Nothing a perl script can't do either.
>>>
>>> If you are really going to do that, please use a coccinelle's semantic
>>> patch (which is designed precisely for that purpose) and document it

> Hi, on the contrary: I don't agree with the change unless a policy ...

I came up with the best :)

# cd /usr/src/linux-2.6

# for i in `grep strncmp ./ -R | cut -d: -f1,1`; \
do \
sed -i '/strncmp/ s//memcmp/g;' $i; \
done;





--

Pavel.

Attachment: 0x03742489.asc
Description: application/pgp-keys