diff options
author | Toomas Soome <tsoome@me.com> | 2018-11-25 23:57:15 +0200 |
---|---|---|
committer | Toomas Soome <tsoome@me.com> | 2019-12-27 18:43:27 +0200 |
commit | 6aa760d176ff3ceaed1f2c3f6c2b45352b83e336 (patch) | |
tree | 3c30241740703b21c42b8ca4fc3ad2d6e78d726c /usr/src/lib/libdiskmgt/common | |
parent | 2f0b63d22a9a05291df8f83619060f9805eb7581 (diff) | |
download | illumos-joyent-6aa760d176ff3ceaed1f2c3f6c2b45352b83e336.tar.gz |
12107 libdiskmgt: cast between incompatible function types
Reviewed by: Matthias Scheler <mscheler@tintri.com>
Approved by: Robert Mustacchi <rm@fingolfin.org>
Diffstat (limited to 'usr/src/lib/libdiskmgt/common')
-rw-r--r-- | usr/src/lib/libdiskmgt/common/events.c | 34 | ||||
-rw-r--r-- | usr/src/lib/libdiskmgt/common/inuse_mnt.c | 9 |
2 files changed, 21 insertions, 22 deletions
diff --git a/usr/src/lib/libdiskmgt/common/events.c b/usr/src/lib/libdiskmgt/common/events.c index 6874000bea..f401871e0a 100644 --- a/usr/src/lib/libdiskmgt/common/events.c +++ b/usr/src/lib/libdiskmgt/common/events.c @@ -89,11 +89,11 @@ static int events_pending = 0; static int sendevents = 0; static void add_event_to_queue(nvlist_t *event); -static void cb_watch_events(); +static void *cb_watch_events(void *); static void event_handler(sysevent_t *ev); static void print_nvlist(char *prefix, nvlist_t *list); -static void walk_devtree(); -static void walker(void *arg); +static void walk_devtree(void); +static void *walker(void *arg); static void(*callback)(nvlist_t *, int) = NULL; @@ -184,9 +184,8 @@ dm_init_event_queue(void (*cb)(nvlist_t *, int), int *errp) /* installing a cb; we didn't have one before */ thread_t watch_thread; - *errp = thr_create(NULL, 0, - (void *(*)(void *))cb_watch_events, NULL, THR_DAEMON, - &watch_thread); + *errp = thr_create(NULL, 0, cb_watch_events, NULL, + THR_DAEMON, &watch_thread); } } @@ -204,8 +203,7 @@ dm_init_event_queue(void (*cb)(nvlist_t *, int), int *errp) callback = cb; - *errp = thr_create(NULL, 0, - (void *(*)(void *))cb_watch_events, NULL, THR_DAEMON, + *errp = thr_create(NULL, 0, cb_watch_events, NULL, THR_DAEMON, &watch_thread); } } @@ -344,8 +342,8 @@ add_event_to_queue(nvlist_t *event) (void) sema_post(&semaphore); } -static void -cb_watch_events() +static void * +cb_watch_events(void *arg __unused) { nvlist_t *event; int error; @@ -355,7 +353,7 @@ cb_watch_events() event = dm_get_event(&error); if (callback == NULL) { /* end the thread */ - return; + return (NULL); } callback(event, error); } @@ -474,7 +472,7 @@ print_nvlist(char *prefix, nvlist_t *list) * drive. */ static void -walk_devtree() +walk_devtree(void) { thread_t walk_thread; @@ -482,7 +480,7 @@ walk_devtree() switch (walker_state) { case WALK_NONE: - if (thr_create(NULL, 0, (void *(*)(void *))walker, NULL, + if (thr_create(NULL, 0, walker, NULL, THR_DAEMON, &walk_thread) == 0) { walker_state = WALK_WAITING; } @@ -500,9 +498,8 @@ walk_devtree() mutex_exit(&walker_lock); } -/*ARGSUSED*/ -static void -walker(void *arg) +static void * +walker(void *arg __unused) { int walk_again = 0; @@ -515,7 +512,7 @@ walker(void *arg) walker_state = WALK_NONE; (void) cond_broadcast(&walker_cv); mutex_exit(&walker_lock); - return; + return (NULL); } walker_state = WALK_RUNNING; mutex_exit(&walker_lock); @@ -527,7 +524,7 @@ walker(void *arg) walker_state = WALK_NONE; (void) cond_broadcast(&walker_cv); mutex_exit(&walker_lock); - return; + return (NULL); } if (events_pending) { @@ -542,4 +539,5 @@ walker(void *arg) mutex_exit(&walker_lock); } while (walk_again); + return (NULL); } diff --git a/usr/src/lib/libdiskmgt/common/inuse_mnt.c b/usr/src/lib/libdiskmgt/common/inuse_mnt.c index a0c921c9a7..f1defae277 100644 --- a/usr/src/lib/libdiskmgt/common/inuse_mnt.c +++ b/usr/src/lib/libdiskmgt/common/inuse_mnt.c @@ -63,7 +63,7 @@ static void free_mnttab(struct mntpnt_list *listp); static boolean_t in_list(struct mntpnt_list *elementp, struct mntpnt_list *listp); static int load_mnttab(int send_event); -static void watch_mnttab(); +static void *watch_mnttab(void *); /* * Search the list of devices from /etc/mnttab to find the mount point @@ -89,7 +89,7 @@ inuse_mnt(char *slice, nvlist_t *attrs, int *errp) if (*errp == 0) { /* start a thread to monitor the mnttab */ - *errp = thr_create(NULL, 0, (void *(*)(void *))watch_mnttab, + *errp = thr_create(NULL, 0, watch_mnttab, NULL, THR_NEW_LWP | THR_DAEMON, &mnttab_thread); } @@ -357,8 +357,8 @@ load_mnttab(int send_event) * that would cause us to flush and reload the cache of mnt entries. Only * changes to /dev devices will cause the cache to be flushed and reloaded. */ -static void -watch_mnttab() +static void * +watch_mnttab(void *arg __unused) { struct pollfd fds[1]; int res; @@ -382,4 +382,5 @@ watch_mnttab() (void) lseek(fds[0].fd, 0, SEEK_SET); } } + return (NULL); } |