From patchwork Fri Nov 16 06:50:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 12896 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 F153D23E13 for ; Fri, 16 Nov 2012 06:57:41 +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 A0D39A18287 for ; Fri, 16 Nov 2012 06:57:41 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so3064408iej.11 for ; Thu, 15 Nov 2012 22:57:41 -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=8K0SMb5WuDtGFv1+GDAhPPG13mLCTEkhXFUOdkxt31w=; b=KbU5VA65eb7h5LTPJz6oHDN62zDhLxP+XxdXTDvgkedi+3w6VVuCOiMybAJfMVNmNM oVXJniWr/74iotGU30xrquDHldM03fdcBL+Pr1QDeVjKXE3cQP6ocwGh81D+9B44Cv53 sw3XAjQDVexyh07m4Yirn3IKdIVrEFmgjCqCh3ULUSQiFIOTEsAV7Uy891oSiD9TZ+Bu 1vKJzZT9nUl7Utxh/JEnox+A04cqhFUqTTGBzwbU9x/axgCfjpE2O/t6cWlbtiPo8Pz+ 5FgcSurroOB2dBMY9Wv5oKfqHbH5xcQph5tJ94AG8nqUex+CpS129NoLn1ch7L+zaB2r UmqQ== Received: by 10.50.186.199 with SMTP id fm7mr2082596igc.62.1353049061304; Thu, 15 Nov 2012 22:57:41 -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 n20csp23386igt; Thu, 15 Nov 2012 22:57:40 -0800 (PST) Received: by 10.66.73.34 with SMTP id i2mr10304158pav.28.1353049060766; Thu, 15 Nov 2012 22:57:40 -0800 (PST) Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by mx.google.com with ESMTPS id gk10si1484446pbc.266.2012.11.15.22.57.40 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 15 Nov 2012 22:57:40 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.52 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=209.85.220.52; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.52 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-f52.google.com with SMTP id bj1so1923175pad.39 for ; Thu, 15 Nov 2012 22:57:40 -0800 (PST) Received: by 10.68.234.100 with SMTP id ud4mr6317843pbc.82.1353049060546; Thu, 15 Nov 2012 22:57:40 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id mz10sm753915pbc.37.2012.11.15.22.57.37 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 15 Nov 2012 22:57:39 -0800 (PST) From: Tushar Behera To: linux-kernel@vger.kernel.org Cc: patches@linaro.org, Arnd Bergmann Subject: [PATCH 13/14] misc: tsl2550: Remove redundant check on unsigned variable Date: Fri, 16 Nov 2012 12:20:45 +0530 Message-Id: <1353048646-10935-14-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: ALoCoQlmymKqbMv00H3dasmRppKDdmj0gcXfhGxxNAwJXCtnXAOwElDGNEawPgtrpADkRM/JYFNT No need to check whether unsigned variable is less than 0. CC: Arnd Bergmann Signed-off-by: Tushar Behera Acked-by: Arnd Bergmann --- drivers/misc/tsl2550.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/misc/tsl2550.c b/drivers/misc/tsl2550.c index 0beb298..0438569 100644 --- a/drivers/misc/tsl2550.c +++ b/drivers/misc/tsl2550.c @@ -204,7 +204,7 @@ static ssize_t tsl2550_store_power_state(struct device *dev, unsigned long val = simple_strtoul(buf, NULL, 10); int ret; - if (val < 0 || val > 1) + if (val > 1) return -EINVAL; mutex_lock(&data->update_lock); @@ -236,7 +236,7 @@ static ssize_t tsl2550_store_operating_mode(struct device *dev, unsigned long val = simple_strtoul(buf, NULL, 10); int ret; - if (val < 0 || val > 1) + if (val > 1) return -EINVAL; if (data->power_state == 0)