[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210803003857.GA1560352@pc>
Date:   Tue, 3 Aug 2021 01:38:57 +0100
From:   Salah Triki <salah.triki@...il.com>
To:     Dmitry Torokhov <dmitry.torokhov@...il.com>,
        Salah Triki <salah.triki@...il.com>,
        Johan Hovold <johan@...nel.org>,
        Lee Jones <lee.jones@...aro.org>, gregkh@...uxfoundation.org
Cc:     linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] input: touchscreen: replace conditional statement with max()
Replace conditional statement with max() in order to make code cleaner.
Issue found by coccinelle.
Signed-off-by: Salah Triki <salah.triki@...il.com>
---
 drivers/input/touchscreen/usbtouchscreen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
index 43c521f50c85..69f36d4f6cea 100644
--- a/drivers/input/touchscreen/usbtouchscreen.c
+++ b/drivers/input/touchscreen/usbtouchscreen.c
@@ -269,7 +269,7 @@ static int e2i_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
 
 	tmp = tmp - 0xA000;
 	dev->touch = (tmp > 0);
-	dev->press = (tmp > 0 ? tmp : 0);
+	dev->press = max(tmp, 0);
 
 	return 1;
 }
-- 
2.25.1
Powered by blists - more mailing lists
 
