From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B2288DDF6B for ; Tue, 11 Mar 2008 08:56:33 +1100 (EST) In-Reply-To: <47D5A585.8050107@tiscali.nl> References: <47D47B11.1000303@tiscali.nl> <20080310084633.5246ecfe@paperstreet.colino.net> <1205136413.8621.3.camel@pasglop> <47D4EFC1.1050403@tiscali.nl> <64d5b5e6dfd0d1820d21db323ef88e25@kernel.crashing.org> <47D5A585.8050107@tiscali.nl> Mime-Version: 1.0 (Apple Message framework v623) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <1dd996a5ad3a455c91886cacd3243128@kernel.crashing.org> From: Segher Boessenkool Subject: Re: ADT746X: logical-bitwise & confusion in set_max_duty_at_crit() Date: Mon, 10 Mar 2008 22:56:00 +0100 To: Roel Kluin <12o3l@tiscali.nl> Cc: lkml , linuxppc-dev@ozlabs.org, Colin Leroy , akpm@linux-foundation.org, "Darrick J. Wong" List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , > It includes suggested changes by Segher Boessenkool and I think this > version was tested by Darrick J. Wong > - u8 reg; > + u8 reg, temp; > struct i2c_client *client = to_i2c_client(dev); > struct adt7473_data *data = i2c_get_clientdata(client); > - int temp = simple_strtol(buf, NULL, 10); > - temp = temp && 0xFF; > + > + temp = simple_strtol(buf, NULL, 10) & 0xFF; It still does this superfluous "& 0xff", which hides the lack of range checking. Segher