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 0C6FFB6EF0 for ; Fri, 18 Dec 2009 14:40:44 +1100 (EST) Subject: Re: [patch 1/5] powerpc: Sky CPU: redundant or incorrect tests on unsigned From: Benjamin Herrenschmidt To: akpm@linux-foundation.org In-Reply-To: <200912180044.nBI0iTbj028399@imap1.linux-foundation.org> References: <200912180044.nBI0iTbj028399@imap1.linux-foundation.org> Content-Type: text/plain; charset="UTF-8" Date: Fri, 18 Dec 2009 14:40:31 +1100 Message-ID: <1261107631.2173.10.camel@pasglop> Mime-Version: 1.0 Cc: gorcunov@gmail.com, linuxppc-dev@ozlabs.org, roel.kluin@gmail.com, waite@skycomputers.com, galak@gate.crashing.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Thu, 2009-12-17 at 16:44 -0800, akpm@linux-foundation.org wrote: > From: Roel Kluin > > count is unsigned and cannot be less than 0. Is this really a powerpc thing ? This driver is only build with CONFIG_HDPU_FEATURES and a git grep HDPU_FEATURES returns no Kconfig that defines it :-) I'm happy to apply such a trivial thing but it's weird isn't it ? Cheers, Ben. > Signed-off-by: Roel Kluin > Acked-by: Cyrill Gorcunov > Cc: Benjamin Herrenschmidt > Cc: Kumar Gala > Cc: Brian Waite > Signed-off-by: Andrew Morton > --- > > drivers/misc/hdpuftrs/hdpu_cpustate.c | 5 ----- > 1 file changed, 5 deletions(-) > > diff -puN drivers/misc/hdpuftrs/hdpu_cpustate.c~powerpc-sky-cpu-redundant-or-incorrect-tests-on-unsigned drivers/misc/hdpuftrs/hdpu_cpustate.c > --- a/drivers/misc/hdpuftrs/hdpu_cpustate.c~powerpc-sky-cpu-redundant-or-incorrect-tests-on-unsigned > +++ a/drivers/misc/hdpuftrs/hdpu_cpustate.c > @@ -121,8 +121,6 @@ static ssize_t cpustate_read(struct file > { > unsigned char data; > > - if (count < 0) > - return -EFAULT; > if (count == 0) > return 0; > > @@ -137,9 +135,6 @@ static ssize_t cpustate_write(struct fil > { > unsigned char data; > > - if (count < 0) > - return -EFAULT; > - > if (count == 0) > return 0; > > _