[PATCH libevdev 1/2] test: drop unnecessary return value
Peter Hutterer
peter.hutterer at who-t.net
Thu Mar 3 21:29:16 UTC 2016
We abort if anything goes wrong anyway, so we never returned anything but
success.
Found by coverity.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
test/test-common.c | 20 ++++++++------------
test/test-common.h | 16 ++++++++--------
test/test-libevdev-events.c | 16 ++++++++--------
3 files changed, 24 insertions(+), 28 deletions(-)
diff --git a/test/test-common.c b/test/test-common.c
index 6449d46..339b278 100644
--- a/test/test-common.c
+++ b/test/test-common.c
@@ -46,9 +46,9 @@ void test_logfunc_ignore_error(enum libevdev_log_priority priority,
{
}
-int test_create_device(struct uinput_device **uidev_return,
- struct libevdev **dev_return,
- ...)
+void test_create_device(struct uinput_device **uidev_return,
+ struct libevdev **dev_return,
+ ...)
{
int rc, fd;
struct uinput_device *uidev;
@@ -71,15 +71,13 @@ int test_create_device(struct uinput_device **uidev_return,
*uidev_return = uidev;
*dev_return = dev;
-
- return rc == 0 ? rc : -errno;
}
-int test_create_abs_device(struct uinput_device **uidev_return,
- struct libevdev **dev_return,
- int nabs,
- const struct input_absinfo *abs,
- ...)
+void test_create_abs_device(struct uinput_device **uidev_return,
+ struct libevdev **dev_return,
+ int nabs,
+ const struct input_absinfo *abs,
+ ...)
{
int rc, fd;
struct uinput_device *uidev;
@@ -117,6 +115,4 @@ int test_create_abs_device(struct uinput_device **uidev_return,
*uidev_return = uidev;
*dev_return = dev;
-
- return rc == 0 ? rc : -errno;
}
diff --git a/test/test-common.h b/test/test-common.h
index 95436fc..47ad476 100644
--- a/test/test-common.h
+++ b/test/test-common.h
@@ -32,14 +32,14 @@
#include "test-common-uinput.h"
-int test_create_device(struct uinput_device **uidev,
- struct libevdev **dev,
- ...);
-int test_create_abs_device(struct uinput_device **uidev,
- struct libevdev **dev,
- int nabs,
- const struct input_absinfo *abs,
- ...);
+void test_create_device(struct uinput_device **uidev,
+ struct libevdev **dev,
+ ...);
+void test_create_abs_device(struct uinput_device **uidev,
+ struct libevdev **dev,
+ int nabs,
+ const struct input_absinfo *abs,
+ ...);
void test_logfunc_abort_on_error(enum libevdev_log_priority priority,
void *data,
diff --git a/test/test-libevdev-events.c b/test/test-libevdev-events.c
index 44447a0..dd2face 100644
--- a/test/test-libevdev-events.c
+++ b/test/test-libevdev-events.c
@@ -1748,10 +1748,10 @@ START_TEST(test_mt_tracking_id_discard)
abs[5].value = ABS_MT_TRACKING_ID;
abs[5].maximum = 500;
- rc = test_create_abs_device(&uidev, &dev,
- 6, abs,
- EV_SYN, SYN_REPORT,
- -1);
+ test_create_abs_device(&uidev, &dev,
+ 6, abs,
+ EV_SYN, SYN_REPORT,
+ -1);
uinput_device_event(uidev, EV_ABS, ABS_MT_SLOT, 1);
uinput_device_event(uidev, EV_ABS, ABS_MT_TRACKING_ID, 1);
@@ -1831,10 +1831,10 @@ START_TEST(test_mt_tracking_id_discard_neg_1)
abs[5].value = ABS_MT_TRACKING_ID;
abs[5].maximum = 500;
- rc = test_create_abs_device(&uidev, &dev,
- 6, abs,
- EV_SYN, SYN_REPORT,
- -1);
+ test_create_abs_device(&uidev, &dev,
+ 6, abs,
+ EV_SYN, SYN_REPORT,
+ -1);
uinput_device_event(uidev, EV_ABS, ABS_MT_SLOT, 1);
uinput_device_event(uidev, EV_ABS, ABS_MT_TRACKING_ID, 1);
uinput_device_event(uidev, EV_SYN, SYN_REPORT, 0);
--
2.5.0
More information about the Input-tools
mailing list