From: Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Cc: Dmitry Torokhov
<dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Ksenija Stanojevic
<ksenija.stanojevic-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Marek Vasut <marex-ynQEQJNshbs@public.gmane.org>,
linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 2/2] input: touchscreen: mxs-lradc: || vs && typos
Date: Thu, 27 Apr 2017 09:03:54 +0100 [thread overview]
Message-ID: <20170427080354.ltqoisfnnnrdki24@dell> (raw)
In-Reply-To: <20170426210431.mqze5ehrijm7l2ey@mwanda>
On Thu, 27 Apr 2017, Dan Carpenter wrote:
> 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 <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Applied, thanks.
> 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",
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
prev parent reply other threads:[~2017-04-27 8:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-26 21:04 [PATCH 2/2] input: touchscreen: mxs-lradc: || vs && typos Dan Carpenter
2017-04-26 21:12 ` Dmitry Torokhov
2017-04-27 8:03 ` Lee Jones [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170427080354.ltqoisfnnnrdki24@dell \
--to=lee.jones-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
--cc=dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
--cc=dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=ksenija.stanojevic-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=marex-ynQEQJNshbs@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox