Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756369AbbFPIUe (ORCPT ); Tue, 16 Jun 2015 04:20:34 -0400 Received: from www.linutronix.de ([62.245.132.108]:42957 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756340AbbFPIUa (ORCPT ); Tue, 16 Jun 2015 04:20:30 -0400 Date: Tue, 16 Jun 2015 10:20:28 +0200 (CEST) From: Thomas Gleixner To: Vikas Shivappa cc: Peter Zijlstra , Vikas Shivappa , linux-kernel@vger.kernel.org, x86@kernel.org, hpa@zytor.com, mingo@kernel.org, matt.fleming@intel.com, will.auld@intel.com, linux-rdt@eclists.intel.com Subject: Re: [PATCH 01/10] cpumask: Introduce cpumask_any_online_but In-Reply-To: Message-ID: References: <1434133037-25189-1-git-send-email-vikas.shivappa@linux.intel.com> <1434133037-25189-2-git-send-email-vikas.shivappa@linux.intel.com> <20150615123614.GA3644@twins.programming.kicks-ass.net> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 917 Lines: 25 On Mon, 15 Jun 2015, Vikas Shivappa wrote: > On Mon, 15 Jun 2015, Peter Zijlstra wrote: > > On Fri, Jun 12, 2015 at 11:17:08AM -0700, Vikas Shivappa wrote: > > > + cpumask_and(&tmp, cpu_online_mask, mask); > > > + cpumask_clear_cpu(cpu, &tmp); > > > + return cpumask_any(&tmp); > > > +} > > > > You had a good example in cpumask_any_but() copy that. > > I saw the cpumask_any_but but wanted to avoid the for loop in the > cpumask_any_but , but now i see why from your previous comment. Without the > cpumask_t I will have to use the cpumask_any_but .. the two were related. It can be done w/o a loop. Hint, you need a static cpumask in your code anyway. Thanks tglx -- 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/