android_kernel_motorola_sm6375/drivers/input
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Nathan Chancellor f6e9e7be9b Input: touchscreen - avoid bitwise vs logical OR warning
commit a02dcde595f7cbd240ccd64de96034ad91cffc40 upstream.

A new warning in clang points out a few places in this driver where a
bitwise OR is being used with boolean types:

drivers/input/touchscreen.c:81:17: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
        data_present = touchscreen_get_prop_u32(dev, "touchscreen-min-x",
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This use of a bitwise OR is intentional, as bitwise operations do not
short circuit, which allows all the calls to touchscreen_get_prop_u32()
to happen so that the last parameter is initialized while coalescing the
results of the calls to make a decision after they are all evaluated.

To make this clearer to the compiler, use the '|=' operator to assign
the result of each touchscreen_get_prop_u32() call to data_present,
which keeps the meaning of the code the same but makes it obvious that
every one of these calls is expected to happen.

Signed-off-by: Nathan Chancellor <[email protected]>
Reported-by: Nick Desaulniers <[email protected]>
Reviewed-by: Nick Desaulniers <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Anders Roxell <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-12-22 09:29:39 +01:00
..
gameport
joystick Input: iforce - fix control-message timeout 2021-11-17 09:48:16 +01:00
keyboard Input: snvs_pwrkey - add clk handling 2021-10-27 09:54:29 +02:00
misc
mouse Input: elantench - fix misreporting trackpoint coordinates 2021-11-17 09:48:16 +01:00
rmi4
serio Input: i8042 - Add quirk for Fujitsu Lifebook T725 2021-11-17 09:48:17 +01:00
tablet
touchscreen Input: touchscreen - avoid bitwise vs logical OR warning 2021-12-22 09:29:39 +01:00
apm-power.c
evbug.c
evdev.c
ff-core.c
ff-memless.c
input-compat.c
input-compat.h
input-leds.c
input-mt.c
input-polldev.c
input-poller.c
input-poller.h
input.c
joydev.c Input: joydev - prevent use of not validated data in JSIOCSBTNMAP ioctl 2021-07-14 16:53:02 +02:00
Kconfig
Makefile
matrix-keymap.c
mousedev.c
sparse-keymap.c