Re: [RFC][PATCH 01/11] ftrace/trivial: Clean up recordmcount.c to useLinux style comparisons

From: Thiago Farina
Date: Fri Apr 22 2011 - 11:53:18 EST


On Fri, Apr 22, 2011 at 12:09 PM, John Reiser <jreiser@xxxxxxxxxxxx> wrote:
> I consider "0==strcmp(" to be an idiom. ÂToo often "strcmp(...) == 0"
> overflows my mental stack because of the typographic width of the operands
> in the source code. ÂIf you still object in this case then please consider
> using something like:
> Â Â Â Â#define strequ(a,b) (strcmp((a), (b)) == 0)
> or
> Â Â Â Âstatic int strequ(char const *a, char const *b)
> Â Â Â Â{
> Â Â Â Â Â Â Â Âreturn strcmp(a, b) == 0;
> Â Â Â Â}
> which names the idiom.
>

Maybe str_eq? Or even just streq? And also just !strcmp(a,b).
--
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/