linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: atmel_mxt_ts - Remove unnecessary byte_offset check
@ 2017-10-08 18:44 Christos Gkekas
  2017-10-08 19:41 ` Nick Dyer
  0 siblings, 1 reply; 4+ messages in thread
From: Christos Gkekas @ 2017-10-08 18:44 UTC (permalink / raw)
  To: Nick Dyer, Dmitry Torokhov, linux-input, linux-kernel; +Cc: Christos Gkekas

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-10-09 21:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-08 18:44 [PATCH] Input: atmel_mxt_ts - Remove unnecessary byte_offset check Christos Gkekas
2017-10-08 19:41 ` Nick Dyer
2017-10-09 17:38   ` Dmitry Torokhov
2017-10-09 21:06     ` Christos Gkekas

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).