From patchwork Mon Jun 22 16:40:02 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: roel kluin X-Patchwork-Id: 29002 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 327E9B70C9 for ; Tue, 23 Jun 2009 00:40:18 +1000 (EST) Received: by ozlabs.org (Postfix) id 2227ADDDA2; Tue, 23 Jun 2009 00:40:18 +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 1FA8EDDDA0 for ; Tue, 23 Jun 2009 00:40:18 +1000 (EST) Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by bilbo.ozlabs.org (Postfix) with ESMTP id BC98EB7413 for ; Tue, 23 Jun 2009 00:39:43 +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 4D660B7154 for ; Tue, 23 Jun 2009 00:39:36 +1000 (EST) Received: by ozlabs.org (Postfix) id 3AE62DDDA1; Tue, 23 Jun 2009 00:39:36 +1000 (EST) Delivered-To: linuxppc-dev@ozlabs.org Received: from mail-ew0-f215.google.com (mail-ew0-f215.google.com [209.85.219.215]) by ozlabs.org (Postfix) with ESMTP id 5C08FDDDA0 for ; Tue, 23 Jun 2009 00:39:34 +1000 (EST) Received: by ewy11 with SMTP id 11so4813501ewy.9 for ; Mon, 22 Jun 2009 07:39:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:content-type :content-transfer-encoding; bh=tm1H3wPKePn+j+lp+UDb7+sJl9JrhOSbXxqS5bbDbUg=; b=s/41+ZY/DDJ1AY7PkDgs798IzrjUXQ+3S/4crnzSa8bgQzfia2Wz9V+OgJiHxOshV2 4FySkzhezCqe3ZVLBN8o46imzNgWTuJjdv2Y2Rhlv+rwyyLcZhaNVylca5OYA+LoeM0d IRTVgtdZbP1pb/NeQFn/ZQo2tXKMhdMX8imL0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=jt3cyOdNfMz44uSimZusQuv9nlaK2saDuETypjnNRNZyKOts09rCtyblCM+h+rFGlY VRzSu+vjF3z7Thvo/ZeXd76vGhvbskBMPQLb1y5rO8F7kmmbdVJ/p+rBIUYB2ScLGlki 9Yt48+imPrFiAjq5kkxK7NXmVRaq9OSV/YvwA= Received: by 10.210.109.10 with SMTP id h10mr7502253ebc.11.1245681572014; Mon, 22 Jun 2009 07:39:32 -0700 (PDT) Received: from zoinx.mars (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id 28sm136587eye.56.2009.06.22.07.39.29 (version=SSLv3 cipher=RC4-MD5); Mon, 22 Jun 2009 07:39:29 -0700 (PDT) Message-ID: <4A3FB3E2.7090309@gmail.com> Date: Mon, 22 Jun 2009 18:40:02 +0200 From: Roel Kluin User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Thunderbird/3.0b2 MIME-Version: 1.0 To: benh@kernel.crashing.org Subject: [PATCH] Sky CPU: redundant or incorrect tests on unsigned Cc: linuxppc-dev@ozlabs.org, Andrew Morton X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.11 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 count is unsigned and cannot be less than 0. Signed-off-by: Roel Kluin --- Can these be removed or do we need an `if (count > MAX)' test, and what should MAX be then? diff --git a/drivers/misc/hdpuftrs/hdpu_cpustate.c b/drivers/misc/hdpuftrs/hdpu_cpustate.c index 176fe4e..35000cf 100644 --- a/drivers/misc/hdpuftrs/hdpu_cpustate.c +++ b/drivers/misc/hdpuftrs/hdpu_cpustate.c @@ -121,8 +121,6 @@ static ssize_t cpustate_read(struct file *file, char *buf, { unsigned char data; - if (count < 0) - return -EFAULT; if (count == 0) return 0; @@ -137,9 +135,6 @@ static ssize_t cpustate_write(struct file *file, const char *buf, { unsigned char data; - if (count < 0) - return -EFAULT; - if (count == 0) return 0;