Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752264AbZL1K6r (ORCPT ); Mon, 28 Dec 2009 05:58:47 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752183AbZL1K6q (ORCPT ); Mon, 28 Dec 2009 05:58:46 -0500 Received: from casper.infradead.org ([85.118.1.10]:46564 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751516AbZL1K6q (ORCPT ); Mon, 28 Dec 2009 05:58:46 -0500 Subject: Re: [PATCH] perf lock: Implement basic sorting function of perf lock From: Peter Zijlstra To: Hitoshi Mitake Cc: Ingo Molnar , linux-kernel@vger.kernel.org, Paul Mackerras , Frederic Weisbecker In-Reply-To: <1261277805-27023-1-git-send-email-mitake@dcl.info.waseda.ac.jp> References: <1261277805-27023-1-git-send-email-mitake@dcl.info.waseda.ac.jp> Content-Type: text/plain; charset="UTF-8" Date: Mon, 28 Dec 2009 11:58:18 +0100 Message-ID: <1261997898.7135.72.camel@laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1096 Lines: 25 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/