From patchwork Sat Jun 28 21:34:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rickard Strandqvist X-Patchwork-Id: 4443711 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4F9E6BEEAA for ; Sat, 28 Jun 2014 21:37:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8D16220328 for ; Sat, 28 Jun 2014 21:37:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AFAC120263 for ; Sat, 28 Jun 2014 21:37:40 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1X10Ft-0002JI-WD; Sat, 28 Jun 2014 21:33:53 +0000 Received: from mail-wi0-f174.google.com ([209.85.212.174]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X10Fq-0002I2-7M for linux-arm-kernel@lists.infradead.org; Sat, 28 Jun 2014 21:33:51 +0000 Received: by mail-wi0-f174.google.com with SMTP id bs8so4362446wib.1 for ; Sat, 28 Jun 2014 14:33:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=h+KCJRjpWN7ktCQFoZHWtNsV0V++GDBzKthzeHLmAwY=; b=CLFBmdw9jBJ3f67YBGRvawFLZwzvD6rwUCUhpj4/GVWALmG1HJOG1yeL83qWyh90mr eTHTe3e7Rh3Ylz8vW4MmEbpNzS9RAPZ3KZ0bE+mDtVNDqAKnpL9k+zeTaJBqd1D6bq+e MnavEW41G99m3tuonZC63d7jDN0qEkUh003TkSX2picUFQ2AAJuimLTPX7N5IUNCNzcG tnr7wuR7XYsLPbj1VSQRpBsxgdCRqD7ig4u7JDciKfarISYGQWjWLEEtzcuy90Zf6MjA iRzgP3w3/vcxL8+1pU2Ae9f3BTZg1O6tXqMz7+n0/INa9n5zaEtCEr/KQbHcj/3KHV5L foyA== X-Gm-Message-State: ALoCoQnuAJ/AJxbrV1niHPCtV5koEiw0KiNjvHGegernihwUNnVTeiOwlEbIe6FWMrPqj4Hl7sbO X-Received: by 10.194.87.134 with SMTP id ay6mr33087655wjb.84.1403991207245; Sat, 28 Jun 2014 14:33:27 -0700 (PDT) Received: from localhost.localdomain (h-245-62.a218.priv.bahnhof.se. [85.24.245.62]) by mx.google.com with ESMTPSA id u10sm30256441wjz.43.2014.06.28.14.33.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 Jun 2014 14:33:26 -0700 (PDT) From: Rickard Strandqvist To: Linus Walleij , Samuel Ortiz Subject: [PATCH] mfd: ab8500-debugfs.c: Cleaning up unnecessary to test, unsigned can't be negative. Date: Sat, 28 Jun 2014 23:34:38 +0200 Message-Id: <1403991279-7109-1-git-send-email-rickard_strandqvist@spectrumdigital.se> X-Mailer: git-send-email 1.7.10.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140628_143350_419682_4ECA6439 X-CRM114-Status: GOOD ( 10.07 ) X-Spam-Score: -0.7 (/) Cc: Lee Jones , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Rickard Strandqvist X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Unsigned variable can't be negative so it is unnecessary to test it This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/mfd/ab8500-debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c index d1a22aa..0793a10 100644 --- a/drivers/mfd/ab8500-debugfs.c +++ b/drivers/mfd/ab8500-debugfs.c @@ -2504,7 +2504,7 @@ static ssize_t ab8500_gpadc_trig_timer_write(struct file *file, if (err) return err; - if ((user_trig_timer >= 0) && (user_trig_timer <= 255)) { + if (user_trig_timer <= 255) { trig_timer = (u8) user_trig_timer; } else { dev_err(dev, "debugfs error input: "