Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754298Ab0LOVsg (ORCPT ); Wed, 15 Dec 2010 16:48:36 -0500 Received: from mail-gx0-f180.google.com ([209.85.161.180]:33117 "EHLO mail-gx0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751281Ab0LOVse convert rfc822-to-8bit (ORCPT ); Wed, 15 Dec 2010 16:48:34 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=CZPQJ0E4I9RTQ56fUYYwv2BpHhdgbzl7B7dqHF45SHign9guTHYXNXWLBhKUL2C7MS /Gh6DpFAJruaDurfi/FptUJ5CZfBr+Z9/8Q+hD/smDBlU14QA+WzUtBeIlHA7PuWYJ15 KQJaa+4HYAUK77d6Z8G/dGwO2hEfpugHB33J4= MIME-Version: 1.0 In-Reply-To: <4D093580.9000303@zytor.com> References: <20101215125626.25f7d648.akpm@linux-foundation.org> <4D092D15.7030700@zytor.com> <4D093580.9000303@zytor.com> Date: Wed, 15 Dec 2010 22:48:33 +0100 Message-ID: Subject: Re: x86: A fast way to check capabilities of the current cpu From: Miguel Ojeda To: "H. Peter Anvin" Cc: Andrew Morton , Christoph Lameter , Tejun Heo , Pekka Enbeerg , linux-kernel@vger.kernel.org, Eric Dumazet , Mathieu Desnoyers Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 747 Lines: 21 On Wed, Dec 15, 2010 at 10:39 PM, H. Peter Anvin wrote: > On 12/15/2010 01:30 PM, Miguel Ojeda wrote: >> >> In this case it this_cpu_*_test_bit() return an int, but they act as a >> bool and are used in if()s; where is the catch? >> > > If they aren't, and are stored in a variable for whatever reason, then > the || form will generate additional instructions to booleanize the > value for no good reason. Thanks! I suppose that is the 't' of being "a fast way" ;-) > > ? ? ? ?-hpa > -- 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/