From patchwork Fri Dec 18 00:44:28 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 41353 X-Patchwork-Delegate: benh@kernel.crashing.org Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 939FD1008F1 for ; Fri, 18 Dec 2009 11:45:21 +1100 (EST) Received: by ozlabs.org (Postfix) id A6761B6F01; Fri, 18 Dec 2009 11:45:14 +1100 (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 34F3FB6EF7 for ; Fri, 18 Dec 2009 11:45:14 +1100 (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 nBI0iaYv004100 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 17 Dec 2009 16:44:37 -0800 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 nBI0iTbj028399; Thu, 17 Dec 2009 16:44:30 -0800 Message-Id: <200912180044.nBI0iTbj028399@imap1.linux-foundation.org> Subject: [patch 1/5] powerpc: Sky CPU: redundant or incorrect tests on unsigned To: benh@kernel.crashing.org From: akpm@linux-foundation.org Date: Thu, 17 Dec 2009 16:44:28 -0800 MIME-Version: 1.0 X-Spam-Status: No, hits=-3.516 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: , 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 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;