From patchwork Thu Aug 6 23:00:36 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 30886 Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 7DE46B7257 for ; Fri, 7 Aug 2009 09:02:00 +1000 (EST) Received: by ozlabs.org (Postfix) id 72BA5DDD0C; Fri, 7 Aug 2009 09:02:00 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (bilbo.ozlabs.org [203.10.76.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "bilbo.ozlabs.org", Issuer "CAcert Class 3 Root" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id 7147DDDD0B for ; Fri, 7 Aug 2009 09:02:00 +1000 (EST) Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by bilbo.ozlabs.org (Postfix) with ESMTP id 44326B81AB for ; Fri, 7 Aug 2009 09:01:02 +1000 (EST) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id AB9FAB7B6D for ; Fri, 7 Aug 2009 09:00:46 +1000 (EST) Received: by ozlabs.org (Postfix) id 9FF71DDDA2; Fri, 7 Aug 2009 09:00:46 +1000 (EST) Delivered-To: linuxppc-dev@ozlabs.org Received: from smtp1.linux-foundation.org (smtp1.linux-foundation.org [140.211.169.13]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "smtp.linux-foundation.org", Issuer "CA Cert Signing Authority" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id 2A4B6DDDA0 for ; Fri, 7 Aug 2009 09:00:45 +1000 (EST) Received: from imap1.linux-foundation.org (imap1.linux-foundation.org [140.211.169.55]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id n76N0bEA016080 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 6 Aug 2009 16:00:38 -0700 Received: from localhost.localdomain (localhost [127.0.0.1]) by imap1.linux-foundation.org (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with ESMTP id n76N0aFC028838; Thu, 6 Aug 2009 16:00:36 -0700 Message-Id: <200908062300.n76N0aFC028838@imap1.linux-foundation.org> Subject: [patch 1/3] powerpc: Sky CPU: redundant or incorrect tests on unsigned To: benh@kernel.crashing.org From: akpm@linux-foundation.org Date: Thu, 06 Aug 2009 16:00:36 -0700 X-Spam-Status: No, hits=-3.512 required=5 tests=AWL, BAYES_00, OSDL_HEADER_SUBJECT_BRACKETED X-Spam-Checker-Version: SpamAssassin 3.2.4-osdl_revision__1.47__ X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.13 Cc: waite@skycomputers.com, roel.kluin@gmail.com, gorcunov@gmail.com, linuxppc-dev@ozlabs.org, galak@gate.crashing.org, akpm@linux-foundation.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org From: Roel Kluin count is unsigned and cannot be less than 0. Signed-off-by: Roel Kluin Cc: 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;