From: Ian Abbott <abbotti@mev.co.uk>
To: linux-staging@lists.linux.dev
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Ian Abbott <abbotti@mev.co.uk>,
H Hartley Sweeten <hsweeten@visionengravers.com>,
"Spencer E . Olson" <olsonse@umich.edu>
Subject: [PATCH 5/5] staging: comedi: tests: Correct unittest_fptr
Date: Wed, 7 Apr 2021 15:01:42 +0100 [thread overview]
Message-ID: <20210407140142.447250-6-abbotti@mev.co.uk> (raw)
In-Reply-To: <20210407140142.447250-1-abbotti@mev.co.uk>
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>
---
.../comedi/drivers/tests/example_test.c | 2 +-
.../comedi/drivers/tests/ni_routes_test.c | 32 +++++++++----------
.../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); \
--
2.31.0
next prev parent reply other threads:[~2021-04-07 14:21 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-07 14:01 [PATCH 0/5] staging: comedi: tests: Fix various issues Ian Abbott
2021-04-07 14:01 ` [PATCH 1/5] staging: comedi: tests: ni_routes_test: Fix compilation error Ian Abbott
2021-04-07 14:01 ` [PATCH 2/5] staging: comedi: tests: ni_routes_test: Put complex values in parentheses Ian Abbott
2021-04-07 14:01 ` [PATCH 3/5] staging: comedi: tests: ni_routes_test: Avoid CamelCase: <RVi> Ian Abbott
2021-04-07 15:23 ` Spencer Olson
2021-04-07 14:01 ` [PATCH 4/5] staging: comedi: tests: ni_routes_test: Lines should not end with a '(' Ian Abbott
2021-04-07 14:01 ` Ian Abbott [this message]
2021-04-07 15:10 ` [PATCH 0/5] staging: comedi: tests: Fix various issues Greg Kroah-Hartman
2021-04-07 15:39 ` Ian Abbott
2021-04-07 15:48 ` Spencer Olson
2021-04-07 16:16 ` Ian Abbott
2021-04-07 17:26 ` Greg Kroah-Hartman
2021-04-07 18:20 ` Ian Abbott
2021-04-08 7:27 ` Greg Kroah-Hartman
2021-04-14 10:09 ` Dan Carpenter
2021-04-14 10:40 ` Ian Abbott
2021-04-14 12:34 ` Ian Abbott
2021-04-14 13:28 ` Dan Carpenter
2021-04-14 13:57 ` Spencer Olson
2021-04-14 17:24 ` Ian Abbott
2021-04-14 14:29 ` Spencer Olson
2021-04-14 17:05 ` Ian Abbott
2021-04-15 9:57 ` Ian Abbott
2021-04-14 12:40 ` Ian Abbott
2021-04-14 13:12 ` Greg Kroah-Hartman
2021-04-14 13:30 ` Dan Carpenter
2021-04-07 15:43 ` Spencer Olson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210407140142.447250-6-abbotti@mev.co.uk \
--to=abbotti@mev.co.uk \
--cc=gregkh@linuxfoundation.org \
--cc=hsweeten@visionengravers.com \
--cc=linux-staging@lists.linux.dev \
--cc=olsonse@umich.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).