From patchwork Fri Nov 16 06:50:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 12894 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 636B223E13 for ; Fri, 16 Nov 2012 06:57:36 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id B2BAEA19CD3 for ; Fri, 16 Nov 2012 06:57:35 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so3064408iej.11 for ; Thu, 15 Nov 2012 22:57:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=KeiaX4DWUZKa7jwDT32mLSyQfLsmGSDWYwGFHQzvu7g=; b=aYcun1goCnIr66/qfI1bislTILVfmDq3pvZBJsZZPpQwlyw/KY5nhKEnqacV8MgXPO +SbuWRLITN+n0jvzR/mvGP0XvNKgKHH1ayysYzyla7EkFekjZFXKcTKN1fkhMN4yJgBk V8qV8HsuibBJ2IsTaKvzSggjc+E53c657jsFZt0JJTnzEvaQ/4aPyZL80TQ2IPSPteJG V6JyRpqF3LR9WJ9NZFPB9cBH/PTT/ZvqUmiiTE+FbvK8OURhfA3QjiogWUjFKFF/UYMu jeM1bVus+N0k8NZ5J6+Sy7MYgzwUwd10MaUU9Lri8aekUyW/gKuHLFnntkYEliKkZQHl uOOQ== Received: by 10.50.42.168 with SMTP id p8mr2251077igl.57.1353049055528; Thu, 15 Nov 2012 22:57:35 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp23377igt; Thu, 15 Nov 2012 22:57:35 -0800 (PST) Received: by 10.66.73.132 with SMTP id l4mr10227700pav.48.1353049054811; Thu, 15 Nov 2012 22:57:34 -0800 (PST) Received: from mail-pa0-f42.google.com (mail-pa0-f42.google.com [209.85.220.42]) by mx.google.com with ESMTPS id h9si1146187paw.163.2012.11.15.22.57.34 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 15 Nov 2012 22:57:34 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.42 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=209.85.220.42; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.42 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) smtp.mail=tushar.behera@linaro.org Received: by mail-pa0-f42.google.com with SMTP id fa1so1656667pad.29 for ; Thu, 15 Nov 2012 22:57:34 -0800 (PST) Received: by 10.68.136.9 with SMTP id pw9mr6394908pbb.155.1353049054589; Thu, 15 Nov 2012 22:57:34 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id mz10sm753915pbc.37.2012.11.15.22.57.31 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 15 Nov 2012 22:57:33 -0800 (PST) From: Tushar Behera To: linux-kernel@vger.kernel.org Cc: patches@linaro.org, Jiri Kosina , linux-usb@vger.kernel.org, linux-input@vger.kernel.org Subject: [PATCH 11/14] HID: hiddev: Remove redundant check on unsigned variable Date: Fri, 16 Nov 2012 12:20:43 +0530 Message-Id: <1353048646-10935-12-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1353048646-10935-1-git-send-email-tushar.behera@linaro.org> References: <1353048646-10935-1-git-send-email-tushar.behera@linaro.org> X-Gm-Message-State: ALoCoQn9B/IjjVCmeYw1S4047xkgODhKuKrHs66xUVqhnFU89ON1kffWgOihzSoE7hNuAtMgxHdJ No need to check whether unsigned variable is less than 0. CC: Jiri Kosina CC: linux-usb@vger.kernel.org CC: linux-input@vger.kernel.org Signed-off-by: Tushar Behera --- drivers/hid/usbhid/hiddev.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c index 14599e2..711c965 100644 --- a/drivers/hid/usbhid/hiddev.c +++ b/drivers/hid/usbhid/hiddev.c @@ -625,7 +625,7 @@ static long hiddev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) break; case HIDIOCAPPLICATION: - if (arg < 0 || arg >= hid->maxapplication) + if (arg >= hid->maxapplication) break; for (i = 0; i < hid->maxcollection; i++)