Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752664AbbG1Qfp (ORCPT ); Tue, 28 Jul 2015 12:35:45 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:41203 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751798AbbG1Qfo (ORCPT ); Tue, 28 Jul 2015 12:35:44 -0400 Date: Tue, 28 Jul 2015 18:35:36 +0200 From: Peter Zijlstra To: Vikas Shivappa Cc: linux-kernel@vger.kernel.org, vikas.shivappa@intel.com, x86@kernel.org, hpa@zytor.com, tglx@linutronix.de, mingo@kernel.org, tj@kernel.org, matt.fleming@intel.com, will.auld@intel.com, glenn.p.williamson@intel.com, kanaka.d.juvva@intel.com Subject: Re: [PATCH 6/9] x86/intel_rdt: Add support for cache bit mask management Message-ID: <20150728163536.GS25159@twins.programming.kicks-ass.net> References: <1435789270-27010-1-git-send-email-vikas.shivappa@linux.intel.com> <1435789270-27010-7-git-send-email-vikas.shivappa@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1435789270-27010-7-git-send-email-vikas.shivappa@linux.intel.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 747 Lines: 25 On Wed, Jul 01, 2015 at 03:21:07PM -0700, Vikas Shivappa wrote: > +static inline bool cbm_is_contiguous(unsigned long var) > +{ > + unsigned long maxcbm = MAX_CBM_LENGTH; > + unsigned long first_bit, zero_bit; > + > + if (!var) > + return false; > + > + first_bit = find_next_bit(&var, maxcbm, 0); We actually have: find_first_bit(). > + zero_bit = find_next_zero_bit(&var, maxcbm, first_bit); > + > + if (find_next_bit(&var, maxcbm, zero_bit) < maxcbm) > + return false; > + > + return true; > +} -- 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/