diff options
author | Ian Abbott <abbotti@mev.co.uk> | 2021-04-07 17:01:42 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-04-07 18:09:55 +0300 |
commit | 07a696a886463a4bb098d8a90ca54356cb270c46 (patch) | |
tree | 789e1f715d9cca1795c58df738bbec9196c7b453 /drivers/staging/comedi | |
parent | 228e55617c17e70a441b070eca457bf88ad3da96 (diff) | |
download | linux-07a696a886463a4bb098d8a90ca54356cb270c46.tar.xz |
staging: comedi: tests: Correct unittest_fptr
The definition of the `unittest_fptr` function pointer type has the
wrong function return type `void *` instead of `void`. The problem is
hidden by a bunch of unnecessary type-casts. Fix the type definition
and remove the type-casts.
Cc: Spencer E. Olson <olsonse@umich.edu>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Link: https://lore.kernel.org/r/20210407140142.447250-6-abbotti@mev.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r-- | drivers/staging/comedi/drivers/tests/example_test.c | 2 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/tests/ni_routes_test.c | 32 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/tests/unittest.h | 2 |
3 files changed, 18 insertions, 18 deletions
diff --git a/drivers/staging/comedi/drivers/tests/example_test.c b/drivers/staging/comedi/drivers/tests/example_test.c index fc65158b8e8e..4d1ab130339d 100644 --- a/drivers/staging/comedi/drivers/tests/example_test.c +++ b/drivers/staging/comedi/drivers/tests/example_test.c @@ -53,7 +53,7 @@ void test0(void) static int __init unittest_enter(void) { const unittest_fptr unit_tests[] = { - (unittest_fptr)test0, + test0, NULL, }; diff --git a/drivers/staging/comedi/drivers/tests/ni_routes_test.c b/drivers/staging/comedi/drivers/tests/ni_routes_test.c index 96e778031da3..777d9b5d96d4 100644 --- a/drivers/staging/comedi/drivers/tests/ni_routes_test.c +++ b/drivers/staging/comedi/drivers/tests/ni_routes_test.c @@ -578,22 +578,22 @@ void test_ni_get_reg_value(void) static int __init ni_routes_unittest(void) { const unittest_fptr unit_tests[] = { - (unittest_fptr)test_ni_assign_device_routes, - (unittest_fptr)test_ni_sort_device_routes, - (unittest_fptr)test_ni_find_route_set, - (unittest_fptr)test_ni_route_set_has_source, - (unittest_fptr)test_ni_route_to_register, - (unittest_fptr)test_ni_lookup_route_register, - (unittest_fptr)test_route_is_valid, - (unittest_fptr)test_ni_is_cmd_dest, - (unittest_fptr)test_channel_is_pfi, - (unittest_fptr)test_channel_is_rtsi, - (unittest_fptr)test_ni_count_valid_routes, - (unittest_fptr)test_ni_get_valid_routes, - (unittest_fptr)test_ni_find_route_source, - (unittest_fptr)test_route_register_is_valid, - (unittest_fptr)test_ni_check_trigger_arg, - (unittest_fptr)test_ni_get_reg_value, + test_ni_assign_device_routes, + test_ni_sort_device_routes, + test_ni_find_route_set, + test_ni_route_set_has_source, + test_ni_route_to_register, + test_ni_lookup_route_register, + test_route_is_valid, + test_ni_is_cmd_dest, + test_channel_is_pfi, + test_channel_is_rtsi, + test_ni_count_valid_routes, + test_ni_get_valid_routes, + test_ni_find_route_source, + test_route_register_is_valid, + test_ni_check_trigger_arg, + test_ni_get_reg_value, NULL, }; diff --git a/drivers/staging/comedi/drivers/tests/unittest.h b/drivers/staging/comedi/drivers/tests/unittest.h index b8e622ea1de1..2da3beea2479 100644 --- a/drivers/staging/comedi/drivers/tests/unittest.h +++ b/drivers/staging/comedi/drivers/tests/unittest.h @@ -27,7 +27,7 @@ static struct unittest_results { int failed; } unittest_results; -typedef void *(*unittest_fptr)(void); +typedef void (*unittest_fptr)(void); #define unittest(result, fmt, ...) ({ \ bool failed = !(result); \ |