lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4B46E70A.7090205@dcl.info.waseda.ac.jp>
Date:	Fri, 08 Jan 2010 17:04:26 +0900
From:	Hitoshi Mitake <mitake@....info.waseda.ac.jp>
To:	Peter Zijlstra <peterz@...radead.org>
CC:	Ingo Molnar <mingo@...e.hu>, linux-kernel@...r.kernel.org,
	Paul Mackerras <paulus@...ba.org>,
	Frederic Weisbecker <fweisbec@...il.com>
Subject: Re: [PATCH] perf lock: Implement basic sorting function of perf lock

On 2009年12月28日 19:58, Peter Zijlstra wrote:
> 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 :-) ]
>
>

Yeah, your way is far smarter than mine :)
Body of this function can be in single line, I'll fix.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ