From e855605616506d5999c4f95a69c9544baa4be4bc Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 19 Jun 2018 15:45:35 +1000 Subject: [PATCH] tools: list-quirks: compress a condition Signed-off-by: Peter Hutterer --- tools/libinput-list-quirks.c | 98 ++++++++++++++++++------------------ 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/tools/libinput-list-quirks.c b/tools/libinput-list-quirks.c index a46b2b96..73dce738 100644 --- a/tools/libinput-list-quirks.c +++ b/tools/libinput-list-quirks.c @@ -73,61 +73,61 @@ static void list_device_quirks(struct quirks_context *ctx, struct udev_device *device) { struct quirks *quirks; + enum quirk qlist[] = { + QUIRK_MODEL_ALPS_TOUCHPAD, + QUIRK_MODEL_APPLE_TOUCHPAD, + QUIRK_MODEL_APPLE_MAGICMOUSE, + QUIRK_MODEL_TABLET_NO_TILT, + QUIRK_MODEL_APPLE_TOUCHPAD_ONEBUTTON, + QUIRK_MODEL_TOUCHPAD_VISIBLE_MARKER, + QUIRK_MODEL_CYBORG_RAT, + QUIRK_MODEL_CHROMEBOOK, + QUIRK_MODEL_HP6910_TOUCHPAD, + QUIRK_MODEL_HP8510_TOUCHPAD, + QUIRK_MODEL_HP_PAVILION_DM4_TOUCHPAD, + QUIRK_MODEL_HP_STREAM11_TOUCHPAD, + QUIRK_MODEL_HP_ZBOOK_STUDIO_G3, + QUIRK_MODEL_TABLET_NO_PROXIMITY_OUT, + QUIRK_MODEL_LENOVO_SCROLLPOINT, + QUIRK_MODEL_LENOVO_X230, + QUIRK_MODEL_LENOVO_T450_TOUCHPAD, + QUIRK_MODEL_TABLET_MODE_NO_SUSPEND, + QUIRK_MODEL_LENOVO_CARBON_X1_6TH, + QUIRK_MODEL_TRACKBALL, + QUIRK_MODEL_LOGITECH_MARBLE_MOUSE, + QUIRK_MODEL_BOUNCING_KEYS, + QUIRK_MODEL_SYNAPTICS_SERIAL_TOUCHPAD, + QUIRK_MODEL_SYSTEM76_BONOBO, + QUIRK_MODEL_CLEVO_W740SU, + QUIRK_MODEL_SYSTEM76_GALAGO, + QUIRK_MODEL_SYSTEM76_KUDU, + QUIRK_MODEL_WACOM_TOUCHPAD, + + + QUIRK_ATTR_SIZE_HINT, + QUIRK_ATTR_TOUCH_SIZE_RANGE, + QUIRK_ATTR_PALM_SIZE_THRESHOLD, + QUIRK_ATTR_LID_SWITCH_RELIABILITY, + QUIRK_ATTR_KEYBOARD_INTEGRATION, + QUIRK_ATTR_TPKBCOMBO_LAYOUT, + QUIRK_ATTR_PRESSURE_RANGE, + QUIRK_ATTR_PALM_PRESSURE_THRESHOLD, + QUIRK_ATTR_RESOLUTION_HINT, + QUIRK_ATTR_TRACKPOINT_RANGE, + }; + enum quirk *q; quirks = quirks_fetch_for_device(ctx, device); if (!quirks) { printf("Device has no quirks defined\n"); - } else { - enum quirk qlist[] = { - QUIRK_MODEL_ALPS_TOUCHPAD, - QUIRK_MODEL_APPLE_TOUCHPAD, - QUIRK_MODEL_APPLE_MAGICMOUSE, - QUIRK_MODEL_TABLET_NO_TILT, - QUIRK_MODEL_APPLE_TOUCHPAD_ONEBUTTON, - QUIRK_MODEL_TOUCHPAD_VISIBLE_MARKER, - QUIRK_MODEL_CYBORG_RAT, - QUIRK_MODEL_CHROMEBOOK, - QUIRK_MODEL_HP6910_TOUCHPAD, - QUIRK_MODEL_HP8510_TOUCHPAD, - QUIRK_MODEL_HP_PAVILION_DM4_TOUCHPAD, - QUIRK_MODEL_HP_STREAM11_TOUCHPAD, - QUIRK_MODEL_HP_ZBOOK_STUDIO_G3, - QUIRK_MODEL_TABLET_NO_PROXIMITY_OUT, - QUIRK_MODEL_LENOVO_SCROLLPOINT, - QUIRK_MODEL_LENOVO_X230, - QUIRK_MODEL_LENOVO_T450_TOUCHPAD, - QUIRK_MODEL_TABLET_MODE_NO_SUSPEND, - QUIRK_MODEL_LENOVO_CARBON_X1_6TH, - QUIRK_MODEL_TRACKBALL, - QUIRK_MODEL_LOGITECH_MARBLE_MOUSE, - QUIRK_MODEL_BOUNCING_KEYS, - QUIRK_MODEL_SYNAPTICS_SERIAL_TOUCHPAD, - QUIRK_MODEL_SYSTEM76_BONOBO, - QUIRK_MODEL_CLEVO_W740SU, - QUIRK_MODEL_SYSTEM76_GALAGO, - QUIRK_MODEL_SYSTEM76_KUDU, - QUIRK_MODEL_WACOM_TOUCHPAD, - - - QUIRK_ATTR_SIZE_HINT, - QUIRK_ATTR_TOUCH_SIZE_RANGE, - QUIRK_ATTR_PALM_SIZE_THRESHOLD, - QUIRK_ATTR_LID_SWITCH_RELIABILITY, - QUIRK_ATTR_KEYBOARD_INTEGRATION, - QUIRK_ATTR_TPKBCOMBO_LAYOUT, - QUIRK_ATTR_PRESSURE_RANGE, - QUIRK_ATTR_PALM_PRESSURE_THRESHOLD, - QUIRK_ATTR_RESOLUTION_HINT, - QUIRK_ATTR_TRACKPOINT_RANGE, - }; - enum quirk *q; + return; + } - ARRAY_FOR_EACH(qlist, q) { - if (!quirks_has_quirk(quirks, *q)) - continue; + ARRAY_FOR_EACH(qlist, q) { + if (!quirks_has_quirk(quirks, *q)) + continue; - printf("%s\n", quirk_get_name(*q)); - } + printf("%s\n", quirk_get_name(*q)); } quirks_unref(quirks); -- 2.34.1