From 6020ce7c9f277aa8f1eb71f542eb998b3a3f8f83 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 20 Feb 2018 13:00:24 +1000 Subject: [PATCH] touchpad: compress a statement Having this initialized and then changed later is more confusing that having the trinary here in one line --- src/evdev-mt-touchpad.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index 3ae1da29..be2df4f0 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -2944,13 +2944,11 @@ tp_init_pressure(struct tp_dispatch *tp, struct evdev_device *device) { const struct input_absinfo *abs; - unsigned int code = ABS_PRESSURE; + unsigned int code; const char *prop; int hi, lo; - if (tp->has_mt) - code = ABS_MT_PRESSURE; - + code = tp->has_mt ? ABS_MT_PRESSURE : ABS_PRESSURE; if (!libevdev_has_event_code(device->evdev, EV_ABS, code)) { tp->pressure.use_pressure = false; return;