Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934372AbXK3N3X (ORCPT ); Fri, 30 Nov 2007 08:29:23 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756402AbXK3N3P (ORCPT ); Fri, 30 Nov 2007 08:29:15 -0500 Received: from venus.billgatliff.com ([209.251.101.201]:49320 "EHLO venus.billgatliff.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752944AbXK3N3O (ORCPT ); Fri, 30 Nov 2007 08:29:14 -0500 X-Greylist: delayed 1497 seconds by postgrey-1.27 at vger.kernel.org; Fri, 30 Nov 2007 08:29:14 EST Message-ID: <47500A4A.10006@billgatliff.com> Date: Fri, 30 Nov 2007 07:04:10 -0600 From: Bill Gatliff User-Agent: Mozilla-Thunderbird 2.0.0.6 (X11/20071009) MIME-Version: 1.0 To: Jean Delvare CC: David Brownell , Linux Kernel list , Felipe Balbi , Haavard Skinnemoen , Andrew Victor , Tony Lindgren , eric miao , Kevin Hilman , Paul Mundt , Ben Dooks Subject: Re: [patch/rfc 2/4] pcf875x I2C GPIO expander driver References: <200710291809.29936.david-b@pacbell.net> <200710291851.49057.david-b@pacbell.net> <20071130133256.72385ea8@hyperion.delvare> In-Reply-To: <20071130133256.72385ea8@hyperion.delvare> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 586 Lines: 24 Jean Delvare wrote: > !!(value & (1 << offset)) > is more efficiently written > (value >> offset) & 1 > ... but not more efficiently implemented. Your version requires code to do the shift on live data at runtime. David's version lets the compiler create the mask once, at compile-time. b.g. -- Bill Gatliff bgat@billgatliff.com - 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/