Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752472AbaKWT3O (ORCPT ); Sun, 23 Nov 2014 14:29:14 -0500 Received: from www.linutronix.de ([62.245.132.108]:35033 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752386AbaKWT3M (ORCPT ); Sun, 23 Nov 2014 14:29:12 -0500 Date: Sun, 23 Nov 2014 20:29:08 +0100 (CET) From: Thomas Gleixner To: Matt Fleming cc: Vikas Shivappa , linux-kernel@vger.kernel.org, vikas.shivappa@intel.com, hpa@zytor.com, mingo@kernel.org, tj@kernel.org, matt.fleming@intel.com, will.auld@intel.com, peterz@infradead.org Subject: Re: [PATCH] x86: Intel Cache Allocation Technology support In-Reply-To: <20141123192613.GA2956@console-pimps.org> Message-ID: References: <20141123192613.GA2956@console-pimps.org> 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 On Sun, 23 Nov 2014, Matt Fleming wrote: > Something like this? > > first_bit = find_next_bit(map, nr_bits, -1); > zero_bit = find_next_zero_bit(map, nr_bits, first_bit); > > if (find_next_bit(map, nr_bits, zero_bit) < nr_bits) > return -EINVAL; /* non-contiguous bits */ Looks pretty self explaining, right? 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/