From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755186AbYJTRKW (ORCPT ); Mon, 20 Oct 2008 13:10:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754363AbYJTREB (ORCPT ); Mon, 20 Oct 2008 13:04:01 -0400 Received: from relay2.sgi.com ([192.48.171.30]:59536 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753898AbYJTRD0 (ORCPT ); Mon, 20 Oct 2008 13:03:26 -0400 Message-Id: <20081020170322.363319000@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:39 -0700 From: Mike Travis To: Ingo Molnar , Rusty Russell Cc: Andi Kleen , Andrew Morton , davej@codemonkey.org.uk, David Miller , Eric Dumazet , Jack Steiner , Jeremy Fitzhardinge , Jes Sorensen , "H. Peter Anvin" , peterz@infradead.org, Thomas Gleixner , Yinghai Lu , IA64 , PowerPC , S390 , SPARC , linux-kernel@vger.kernel.org Subject: [PATCH 20/35] cpumask: cpumask_of(): cpumask_of_cpu() which returns a pointer. Content-Disposition: inline; filename=cpumask:cpumask_of.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This deprecates cpumask_of_cpu(), which returns a cpumask_t (cpumask_of() returns a const pointer, instead). From: Rusty Russell Signed-off-by: Rusty Russell Signed-off-by: Mike Travis --- include/linux/cpumask.h | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) --- linux-2.6.28.orig/include/linux/cpumask.h +++ linux-2.6.28/include/linux/cpumask.h @@ -52,8 +52,7 @@ * void cpumask_copy(dmask, smask) dmask = smask * * size_t cpumask_size() Length of cpumask in bytes. - * cpumask_t cpumask_of_cpu(cpu) Return cpumask with bit 'cpu' set - * (can be used as an lvalue) + * const struct cpumask *cpumask_of(cpu) Return cpumask with bit 'cpu' set * CPU_MASK_ALL Initializer - all bits set * CPU_MASK_NONE Initializer - no bits set * unsigned long *cpumask_bits(mask) Array of unsigned long's in mask @@ -176,6 +175,7 @@ extern cpumask_t _unused_cpumask_arg_; #define next_cpu_nr(n, src) next_cpu(n, src) #define cpus_weight_nr(cpumask) cpus_weight(cpumask) #define for_each_cpu_mask_nr(cpu, mask) for_each_cpu_mask(cpu, mask) +#define cpumask_of_cpu(cpu) (*cpumask_of(cpu)) /* End deprecated region. */ #if NR_CPUS <= BITS_PER_LONG @@ -382,21 +382,13 @@ static inline void cpumask_copy(struct c extern const unsigned long cpu_bit_bitmap[BITS_PER_LONG+1][BITS_TO_LONGS(NR_CPUS)]; -static inline const cpumask_t *get_cpu_mask(unsigned int cpu) +static inline const struct cpumask *cpumask_of(unsigned int cpu) { const unsigned long *p = cpu_bit_bitmap[1 + cpu % BITS_PER_LONG]; p -= cpu / BITS_PER_LONG; - return (const cpumask_t *)p; + return (const struct cpumask *)p; } -/* - * In cases where we take the address of the cpumask immediately, - * gcc optimizes it out (it's a constant) and there's no huge stack - * variable created: - */ -#define cpumask_of_cpu(cpu) (*get_cpu_mask(cpu)) - - #define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS) #if NR_CPUS <= BITS_PER_LONG --