input: touchscreen: replace conditional statement with max()
Subsystems (2)
PATCH 1/1 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 <[email protected]>
--- drivers/input/touchscreen/usbtouchscreen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/touchscreen/usbtouchscreen.c +1 -1
@@ -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 ; }
Signature · 1 line
2.25.1
Quoted 13 lines · Salah Triki
Replace conditional statement with
max()in order to make code cleaner. Issue found by coccinelle.Signed-off-by Salah Triki <[email protected]>--- drivers/input/touchscreen/usbtouchscreen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/input/touchscreen/usbtouchscreen.c +0
-0
drivers/input/touchscreen/usbtouchscreen.c static int e2i_read_data(struct usbtouch_usb *dev, unsigned char *pkt) · line 272
Quoted 5 lines
drivers/input/touchscreen/usbtouchscreen.c +1
-1@@ -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 );
I'm afraid that like the related patch you've posted elsewhere, this not an improvement either.
drivers/input/touchscreen/usbtouchscreen.c static int e2i_read_data(struct usbtouch_usb *dev, unsigned char *pkt) · line 275
Quoted 3 lines
drivers/input/touchscreen/usbtouchscreen.c +0
-0return 1 ; }
Johan