From patchwork Wed Apr 26 21:04:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 9702017 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2AC9C603F6 for ; Wed, 26 Apr 2017 21:04:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B3EC28404 for ; Wed, 26 Apr 2017 21:04:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0FC3728437; Wed, 26 Apr 2017 21:04:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9178328404 for ; Wed, 26 Apr 2017 21:04:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967636AbdDZVEt (ORCPT ); Wed, 26 Apr 2017 17:04:49 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:44178 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967633AbdDZVEt (ORCPT ); Wed, 26 Apr 2017 17:04:49 -0400 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v3QL4eFR009974 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Apr 2017 21:04:40 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v3QL4dsI022891 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Apr 2017 21:04:40 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v3QL4dgb003856; Wed, 26 Apr 2017 21:04:39 GMT Received: from mwanda (/197.254.35.146) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 26 Apr 2017 14:04:38 -0700 Date: Thu, 27 Apr 2017 00:04:31 +0300 From: Dan Carpenter To: Dmitry Torokhov , Ksenija Stanojevic Cc: Lee Jones , Marek Vasut , linux-input@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-iio@vger.kernel.org Subject: [PATCH 2/2] input: touchscreen: mxs-lradc: || vs && typos Message-ID: <20170426210431.mqze5ehrijm7l2ey@mwanda> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: NeoMutt/20170113 (1.7.2) X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP These tests are meaningless as is because "adapt" can't possibly be both less than 1 and greater than 32. Fixes: d81ca730e3e4 ("input: touchscreen: mxs-lradc: Add support for touchscreen") Signed-off-by: Dan Carpenter Acked-by: Dmitry Torokhov --- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/input/touchscreen/mxs-lradc-ts.c b/drivers/input/touchscreen/mxs-lradc-ts.c index ff9cda29d9a0..369ef83234ef 100644 --- a/drivers/input/touchscreen/mxs-lradc-ts.c +++ b/drivers/input/touchscreen/mxs-lradc-ts.c @@ -642,7 +642,7 @@ static int mxs_lradc_ts_probe(struct platform_device *pdev) if (of_property_read_u32(node, "fsl,ave-ctrl", &adapt)) { ts->over_sample_cnt = 4; } else { - if (adapt >= 1 || adapt <= 32) { + if (adapt >= 1 && adapt <= 32) { ts->over_sample_cnt = adapt; } else { dev_err(ts->dev, "Invalid sample count (%u)\n", @@ -654,7 +654,7 @@ static int mxs_lradc_ts_probe(struct platform_device *pdev) if (of_property_read_u32(node, "fsl,ave-delay", &adapt)) { ts->over_sample_delay = 2; } else { - if (adapt >= 2 || adapt <= LRADC_DELAY_DELAY_MASK + 1) { + if (adapt >= 2 && adapt <= LRADC_DELAY_DELAY_MASK + 1) { ts->over_sample_delay = adapt; } else { dev_err(ts->dev, "Invalid sample delay (%u)\n", @@ -666,7 +666,7 @@ static int mxs_lradc_ts_probe(struct platform_device *pdev) if (of_property_read_u32(node, "fsl,settling", &adapt)) { ts->settling_delay = 10; } else { - if (adapt >= 1 || adapt <= LRADC_DELAY_DELAY_MASK) { + if (adapt >= 1 && adapt <= LRADC_DELAY_DELAY_MASK) { ts->settling_delay = adapt; } else { dev_err(ts->dev, "Invalid settling delay (%u)\n",