touchpad: silence Coverity warnings about uninitialized use
authorPeter Hutterer <peter.hutterer@who-t.net>
Fri, 22 Aug 2014 05:15:17 +0000 (15:15 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Tue, 26 Aug 2014 01:04:42 +0000 (11:04 +1000)
container_of() accesses tp for offset calculation. Which is fine, but
Coverity doesn't know that.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/evdev-mt-touchpad-tap.c

index fae8f5e80e8fd1cc5d0e7926058e153e5a4b20c4..c05b45ceeb0e16eeb4697b45440e292f882f6342 100644 (file)
@@ -617,7 +617,7 @@ static int
 tp_tap_config_count(struct libinput_device *device)
 {
        struct evdev_dispatch *dispatch;
-       struct tp_dispatch *tp;
+       struct tp_dispatch *tp = NULL;
 
        dispatch = ((struct evdev_device *) device)->dispatch;
        tp = container_of(dispatch, tp, base);
@@ -630,7 +630,7 @@ tp_tap_config_set_enabled(struct libinput_device *device,
                          enum libinput_config_tap_state enabled)
 {
        struct evdev_dispatch *dispatch;
-       struct tp_dispatch *tp;
+       struct tp_dispatch *tp = NULL;
 
        dispatch = ((struct evdev_device *) device)->dispatch;
        tp = container_of(dispatch, tp, base);
@@ -644,7 +644,7 @@ static enum libinput_config_tap_state
 tp_tap_config_is_enabled(struct libinput_device *device)
 {
        struct evdev_dispatch *dispatch;
-       struct tp_dispatch *tp;
+       struct tp_dispatch *tp = NULL;
 
        dispatch = ((struct evdev_device *) device)->dispatch;
        tp = container_of(dispatch, tp, base);