From: Christos Gkekas <chris.gekas@gmail.com>
To: Nick Dyer <nick@shmanahar.org>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Christos Gkekas <chris.gekas@gmail.com>
Subject: [PATCH] Input: atmel_mxt_ts - Remove unnecessary byte_offset check
Date: Sun, 8 Oct 2017 19:44:18 +0100 [thread overview]
Message-ID: <1507488258-22409-1-git-send-email-chris.gekas@gmail.com> (raw)
Variable byte_offset is unsigned so checking whether it is greater or
equal to zero is redundant.
Signed-off-by: Christos Gkekas <chris.gekas@gmail.com>
---
drivers/input/touchscreen/atmel_mxt_ts.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index 7659bc4..baafaed 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -1356,7 +1356,7 @@ static int mxt_prepare_cfg_mem(struct mxt_data *data,
byte_offset = reg + i - cfg_start_ofs;
- if (byte_offset >= 0 && byte_offset < config_mem_size) {
+ if (byte_offset < config_mem_size) {
*(config_mem + byte_offset) = val;
} else {
dev_err(dev, "Bad object: reg:%d, T%d, ofs=%d\n",
--
2.7.4
next reply other threads:[~2017-10-08 18:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-08 18:44 Christos Gkekas [this message]
2017-10-08 19:41 ` [PATCH] Input: atmel_mxt_ts - Remove unnecessary byte_offset check Nick Dyer
2017-10-09 17:38 ` Dmitry Torokhov
2017-10-09 21:06 ` Christos Gkekas
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=1507488258-22409-1-git-send-email-chris.gekas@gmail.com \
--to=chris.gekas@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nick@shmanahar.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;
as well as URLs for NNTP newsgroup(s).