Re: [PATCH] perf lock: Implement basic sorting function of perflock
From: Peter Zijlstra
Date: Mon Dec 28 2009 - 05:58:50 EST
On Sun, 2009-12-20 at 11:56 +0900, Hitoshi Mitake wrote:
> +#define SINGLE_KEY(member) \
> + static int lock_stat_key_ ## member(struct lock_stat *one, \
> + struct lock_stat *two) \
> + { \
> + if (one->member > two->member) \
> + return 1; \
> + else \
> + return 0; \
> + }
Seems to me:
return one->member > two->member;
Should suffice, no?
[ I usually call the arguments to a comparator (l)eft/(r)ight or a/b,
but I guess one/two works too :-) ]
--
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/