From patchwork Mon Oct 20 17:03:21 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Travis X-Patchwork-Id: 5085 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id B2FA9474EC for ; Tue, 21 Oct 2008 04:04:42 +1100 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: from relay.sgi.com (relay2.sgi.com [192.48.171.30]) by ozlabs.org (Postfix) with ESMTP id 48A7DDDEDD for ; Tue, 21 Oct 2008 04:03:24 +1100 (EST) Received: from polaris-admin.engr.sgi.com (polaris-admin.engr.sgi.com [192.102.97.111]) by relay2.corp.sgi.com (Postfix) with ESMTP id 788E9304107; Mon, 20 Oct 2008 10:03:20 -0700 (PDT) Received: by polaris-admin.engr.sgi.com (Postfix, from userid 5508) id F3391517A556; Mon, 20 Oct 2008 10:03:19 -0700 (PDT) Message-Id: <20081020170319.867619000@polaris-admin.engr.sgi.com> References: <20081020170319.539427000@polaris-admin.engr.sgi.com> User-Agent: quilt/0.46-1 Date: Mon, 20 Oct 2008 10:03:21 -0700 From: Mike Travis To: Ingo Molnar , Rusty Russell Subject: [PATCH 02/35] cpumask: remove min from first_cpu/next_cpu Content-Disposition: inline; filename=cpumask:remove-min.patch Cc: davej@codemonkey.org.uk, Jeremy Fitzhardinge , Jes Sorensen , IA64 , S390 , peterz@infradead.org, Jack Steiner , linux-kernel@vger.kernel.org, Eric Dumazet , PowerPC , Andi Kleen , Thomas Gleixner , Yinghai Lu , "H. Peter Anvin" , SPARC , Andrew Morton , David Miller X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Seems like this has been here forever, but I can't see why: find_first_bit and find_next_bit both return >= NR_CPUS on failure. From: Rusty Russell Signed-off-by: Rusty Russell Signed-off-by: Mike Travis --- lib/cpumask.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) --- linux-2.6.28.orig/lib/cpumask.c +++ linux-2.6.28/lib/cpumask.c @@ -5,21 +5,20 @@ int __first_cpu(const cpumask_t *srcp) { - return min_t(int, NR_CPUS, find_first_bit(srcp->bits, NR_CPUS)); + return find_first_bit(srcp->bits, NR_CPUS); } EXPORT_SYMBOL(__first_cpu); int __next_cpu(int n, const cpumask_t *srcp) { - return min_t(int, NR_CPUS, find_next_bit(srcp->bits, NR_CPUS, n+1)); + return find_next_bit(srcp->bits, NR_CPUS, n+1); } EXPORT_SYMBOL(__next_cpu); #if NR_CPUS > 64 int __next_cpu_nr(int n, const cpumask_t *srcp) { - return min_t(int, nr_cpu_ids, - find_next_bit(srcp->bits, nr_cpu_ids, n+1)); + return find_next_bit(srcp->bits, nr_cpu_ids, n+1); } EXPORT_SYMBOL(__next_cpu_nr); #endif