summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2018-11-27 14:24:43 +0200
committerToomas Soome <tsoome@me.com>2020-02-27 08:41:48 +0200
commit1743a90d9abccc6cd1e57ef89729c674b859fc6e (patch)
treeef8c83c6aa419bba3b554ae8aef979a3c9ed41bc
parent2944b91ec59a95e39012331cb055e960ae6d4489 (diff)
downloadillumos-joyent-1743a90d9abccc6cd1e57ef89729c674b859fc6e.tar.gz
12099 fm: cast between incompatible function types
Reviewed by: Matthias Scheler <mscheler@tintri.com> Approved by: Robert Mustacchi <rm@fingolfin.org>
-rw-r--r--usr/src/cmd/fm/fmd/common/fmd.c4
-rw-r--r--usr/src/cmd/fm/fmd/common/fmd.h3
-rw-r--r--usr/src/cmd/fm/fmd/common/fmd_api.c2
-rw-r--r--usr/src/cmd/fm/fmd/common/fmd_case.c8
-rw-r--r--usr/src/cmd/fm/fmd/common/fmd_case.h4
-rw-r--r--usr/src/cmd/fm/fmd/common/fmd_ckpt.c10
-rw-r--r--usr/src/cmd/fm/fmd/common/fmd_mdb.c23
-rw-r--r--usr/src/cmd/fm/fmd/common/fmd_module.c11
-rw-r--r--usr/src/cmd/fm/fmd/common/fmd_scheme.c65
-rw-r--r--usr/src/cmd/fm/fmd/common/fmd_serd.c11
-rw-r--r--usr/src/cmd/fm/fmd/common/fmd_serd.h10
-rw-r--r--usr/src/cmd/fm/fmd/common/fmd_thread.c4
-rw-r--r--usr/src/cmd/fm/fmd/common/fmd_time.c11
-rw-r--r--usr/src/cmd/fm/fmdump/common/scheme.c9
-rw-r--r--usr/src/lib/fm/libfmd_snmp/common/module.c8
-rw-r--r--usr/src/lib/fm/libfmd_snmp/common/problem.c8
-rw-r--r--usr/src/lib/fm/libfmd_snmp/common/resource.c8
-rw-r--r--usr/src/lib/fm/libfmd_snmp/common/scheme.c18
18 files changed, 121 insertions, 96 deletions
diff --git a/usr/src/cmd/fm/fmd/common/fmd.c b/usr/src/cmd/fm/fmd/common/fmd.c
index 8177c81049..7369a68047 100644
--- a/usr/src/cmd/fm/fmd/common/fmd.c
+++ b/usr/src/cmd/fm/fmd/common/fmd.c
@@ -169,8 +169,8 @@ fmd_trmode_set(fmd_conf_param_t *pp, const char *value)
else
return (fmd_set_errno(EFMD_CONF_INVAL));
- fmd.d_thr_trace = (void (*)())func;
- pp->cp_value.cpv_ptr = (void *)func;
+ fmd.d_thr_trace = func;
+ pp->cp_value.cpv_ptr = func;
return (0);
}
diff --git a/usr/src/cmd/fm/fmd/common/fmd.h b/usr/src/cmd/fm/fmd/common/fmd.h
index 272fa3c305..fa2d4710b7 100644
--- a/usr/src/cmd/fm/fmd/common/fmd.h
+++ b/usr/src/cmd/fm/fmd/common/fmd.h
@@ -36,6 +36,7 @@ extern "C" {
#include <fmd_list.h>
#include <fmd_time.h>
#include <fmd_api.h>
+#include <fmd_trace.h>
struct fmd_conf; /* see <fmd_conf.h> */
struct fmd_dispq; /* see <fmd_dispq.h> */
@@ -89,7 +90,7 @@ typedef struct fmd {
pthread_mutex_t d_thr_lock; /* lock for d_thr_list */
fmd_list_t d_thr_list; /* list of all fmd_thread_t's */
- void (*d_thr_trace)(); /* thread trace buffer function */
+ fmd_tracebuf_f *d_thr_trace; /* thread trace buffer function */
int d_thr_sig; /* cached copy of client.thrsig */
pthread_mutex_t d_mod_lock; /* lock for d_mod_list */
diff --git a/usr/src/cmd/fm/fmd/common/fmd_api.c b/usr/src/cmd/fm/fmd/common/fmd_api.c
index 008a55c90f..594e41896d 100644
--- a/usr/src/cmd/fm/fmd/common/fmd_api.c
+++ b/usr/src/cmd/fm/fmd/common/fmd_api.c
@@ -1872,7 +1872,7 @@ fmd_doorthr_create(door_info_t *dip, void *(*crf)(void *), void *crarg,
return (0);
}
- if ((new_tp = fmd_doorthread_create(mp, (fmd_thread_f *)crf,
+ if ((new_tp = fmd_doorthread_create(mp, (fmd_thread_f *)(uintptr_t)crf,
crarg)) != NULL) {
tid = new_tp->thr_tid;
mp->mod_stats->ms_doorthrtotal.fmds_value.ui32++;
diff --git a/usr/src/cmd/fm/fmd/common/fmd_case.c b/usr/src/cmd/fm/fmd/common/fmd_case.c
index dff15220a7..9ffa939cd1 100644
--- a/usr/src/cmd/fm/fmd/common/fmd_case.c
+++ b/usr/src/cmd/fm/fmd/common/fmd_case.c
@@ -1572,9 +1572,9 @@ fmd_case_rele_locked(fmd_case_t *cp)
}
int
-fmd_case_insert_principal(fmd_case_t *cp, fmd_event_t *ep)
+fmd_case_insert_principal(void *cp, fmd_event_t *ep)
{
- fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
+ fmd_case_impl_t *cip = cp;
fmd_case_item_t *cit;
fmd_event_t *oep;
uint_t state;
@@ -1611,9 +1611,9 @@ fmd_case_insert_principal(fmd_case_t *cp, fmd_event_t *ep)
}
int
-fmd_case_insert_event(fmd_case_t *cp, fmd_event_t *ep)
+fmd_case_insert_event(void *cp, fmd_event_t *ep)
{
- fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
+ fmd_case_impl_t *cip = cp;
fmd_case_item_t *cit;
uint_t state;
int new;
diff --git a/usr/src/cmd/fm/fmd/common/fmd_case.h b/usr/src/cmd/fm/fmd/common/fmd_case.h
index 733826e91c..92b6a91de5 100644
--- a/usr/src/cmd/fm/fmd/common/fmd_case.h
+++ b/usr/src/cmd/fm/fmd/common/fmd_case.h
@@ -130,8 +130,8 @@ extern void fmd_case_rele(fmd_case_t *);
extern void fmd_case_rele_locked(fmd_case_t *);
extern void fmd_case_update(fmd_case_t *);
-extern int fmd_case_insert_principal(fmd_case_t *, fmd_event_t *);
-extern int fmd_case_insert_event(fmd_case_t *, fmd_event_t *);
+extern int fmd_case_insert_principal(void *, fmd_event_t *);
+extern int fmd_case_insert_event(void *, fmd_event_t *);
extern void fmd_case_insert_suspect(fmd_case_t *, nvlist_t *);
extern void fmd_case_recreate_suspect(fmd_case_t *, nvlist_t *);
diff --git a/usr/src/cmd/fm/fmd/common/fmd_ckpt.c b/usr/src/cmd/fm/fmd/common/fmd_ckpt.c
index 4bae10f7b4..c923cbbb22 100644
--- a/usr/src/cmd/fm/fmd/common/fmd_ckpt.c
+++ b/usr/src/cmd/fm/fmd/common/fmd_ckpt.c
@@ -894,7 +894,7 @@ fmd_ckpt_strptr(fmd_ckpt_t *ckp, fcf_stridx_t sid, const char *defstr)
static void
fmd_ckpt_restore_events(fmd_ckpt_t *ckp, fcf_secidx_t sid,
- void (*func)(void *, fmd_event_t *), void *arg)
+ int (*func)(void *, fmd_event_t *), void *arg)
{
const fcf_event_t *fcfe;
const fcf_sec_t *sp;
@@ -942,7 +942,7 @@ fmd_ckpt_restore_events(fmd_ckpt_t *ckp, fcf_secidx_t sid,
ep = fmd_event_recreate(FMD_EVT_PROTOCOL,
&ftv, NULL, NULL, lp, fcfe->fcfe_offset, 0);
fmd_event_hold(ep);
- func(arg, ep);
+ (void) func(arg, ep);
fmd_event_rele(ep);
fcfe = (fcf_event_t *)((uintptr_t)fcfe + sp->fcfs_entsize);
@@ -1050,10 +1050,10 @@ fmd_ckpt_restore_case(fmd_ckpt_t *ckp, fmd_module_t *mp, const fcf_sec_t *sp)
}
fmd_ckpt_restore_events(ckp, fcfc->fcfc_principal,
- (void (*)(void *, fmd_event_t *))fmd_case_insert_principal, cp);
+ fmd_case_insert_principal, cp);
fmd_ckpt_restore_events(ckp, fcfc->fcfc_events,
- (void (*)(void *, fmd_event_t *))fmd_case_insert_event, cp);
+ fmd_case_insert_event, cp);
/*
* Once solved, treat suspects from resource cache as master copy.
@@ -1105,7 +1105,7 @@ fmd_ckpt_restore_serd(fmd_ckpt_t *ckp, fmd_module_t *mp, const fcf_sec_t *sp)
fmd_module_lock(mp);
fmd_ckpt_restore_events(ckp, fcfd->fcfd_events,
- (void (*)(void *, fmd_event_t *))fmd_serd_eng_record,
+ fmd_serd_eng_record,
fmd_serd_eng_lookup(&mp->mod_serds, s));
fmd_module_unlock(mp);
diff --git a/usr/src/cmd/fm/fmd/common/fmd_mdb.c b/usr/src/cmd/fm/fmd/common/fmd_mdb.c
index 8ad141ab27..c24d0cee39 100644
--- a/usr/src/cmd/fm/fmd/common/fmd_mdb.c
+++ b/usr/src/cmd/fm/fmd/common/fmd_mdb.c
@@ -208,8 +208,11 @@ trwalk_fini(mdb_walk_state_t *wsp)
/*ARGSUSED*/
static int
-trprint_msg(uintptr_t addr, const fmd_tracerec_t *trp, uintptr_t tid)
+trprint_msg(uintptr_t addr, const void *arg, void *arg1)
{
+ const fmd_tracerec_t *trp = arg;
+ uintptr_t tid = (uintptr_t)arg1;
+
if (tid == 0)
mdb_printf("%3lu ", trp->tr_stack[trp->tr_depth]);
else if (trp->tr_stack[trp->tr_depth] != tid)
@@ -223,8 +226,10 @@ trprint_msg(uintptr_t addr, const fmd_tracerec_t *trp, uintptr_t tid)
/*ARGSUSED*/
static int
-trprint_cpp(uintptr_t addr, const fmd_tracerec_t *trp, uintptr_t tid)
+trprint_cpp(uintptr_t addr, const void *arg, void *arg1)
{
+ const fmd_tracerec_t *trp = arg;
+ uintptr_t tid = (uintptr_t)arg1;
char file[64];
if (tid == 0)
@@ -254,17 +259,19 @@ trprint_stack(const fmd_tracerec_t *trp)
}
static int
-trprint_msg_stack(uintptr_t addr, const fmd_tracerec_t *trp, uintptr_t tid)
+trprint_msg_stack(uintptr_t addr, const void *arg, void *arg1)
{
- int status = trprint_msg(addr, trp, tid);
+ const fmd_tracerec_t *trp = arg;
+ int status = trprint_msg(addr, trp, arg1);
trprint_stack(trp);
return (status);
}
static int
-trprint_cpp_stack(uintptr_t addr, const fmd_tracerec_t *trp, uintptr_t tid)
+trprint_cpp_stack(uintptr_t addr, const void *arg, void *arg1)
{
- int status = trprint_cpp(addr, trp, tid);
+ const fmd_tracerec_t *trp = arg;
+ int status = trprint_cpp(addr, trp, arg1);
trprint_stack(trp);
return (status);
}
@@ -272,7 +279,7 @@ trprint_cpp_stack(uintptr_t addr, const fmd_tracerec_t *trp, uintptr_t tid)
static int
fmd_trace(uintptr_t tid, uint_t flags, int argc, const mdb_arg_t *argv)
{
- int (*func)(uintptr_t, const fmd_tracerec_t *, uintptr_t);
+ int (*func)(uintptr_t, const void *, void *);
uint_t opt_c = FALSE, opt_s = FALSE;
if (mdb_getopts(argc, argv,
@@ -293,7 +300,7 @@ fmd_trace(uintptr_t tid, uint_t flags, int argc, const mdb_arg_t *argv)
func = opt_s ? trprint_msg_stack : trprint_msg;
}
- if (mdb_walk("fmd_trace", (mdb_walk_cb_t)func, (void *)tid) == -1) {
+ if (mdb_walk("fmd_trace", func, (void *)tid) == -1) {
mdb_warn("failed to walk fmd_trace");
return (DCMD_ERR);
}
diff --git a/usr/src/cmd/fm/fmd/common/fmd_module.c b/usr/src/cmd/fm/fmd/common/fmd_module.c
index ad3b8f424d..5fe1c701ce 100644
--- a/usr/src/cmd/fm/fmd/common/fmd_module.c
+++ b/usr/src/cmd/fm/fmd/common/fmd_module.c
@@ -641,8 +641,7 @@ fmd_module_gc(fmd_module_t *mp)
fmd_module_lock(mp);
if ((info = mp->mod_info) != NULL) {
- fmd_serd_hash_apply(&mp->mod_serds,
- (fmd_serd_eng_f *)fmd_serd_eng_gc, NULL);
+ fmd_serd_hash_apply(&mp->mod_serds, fmd_serd_eng_gc, NULL);
}
fmd_module_unlock(mp);
@@ -657,8 +656,7 @@ void
fmd_module_trygc(fmd_module_t *mp)
{
if (fmd_module_trylock(mp)) {
- fmd_serd_hash_apply(&mp->mod_serds,
- (fmd_serd_eng_f *)fmd_serd_eng_gc, NULL);
+ fmd_serd_hash_apply(&mp->mod_serds, fmd_serd_eng_gc, NULL);
fmd_module_unlock(mp);
}
}
@@ -715,7 +713,7 @@ fmd_module_clrdirty(fmd_module_t *mp)
if (mp->mod_flags & FMD_MOD_MDIRTY) {
fmd_serd_hash_apply(&mp->mod_serds,
- (fmd_serd_eng_f *)fmd_serd_eng_clrdirty, NULL);
+ fmd_serd_eng_clrdirty, NULL);
fmd_buf_hash_commit(&mp->mod_bufs);
}
@@ -740,8 +738,7 @@ fmd_module_commit(fmd_module_t *mp)
}
if (mp->mod_flags & FMD_MOD_MDIRTY) {
- fmd_serd_hash_apply(&mp->mod_serds,
- (fmd_serd_eng_f *)fmd_serd_eng_commit, NULL);
+ fmd_serd_hash_apply(&mp->mod_serds, fmd_serd_eng_commit, NULL);
fmd_buf_hash_commit(&mp->mod_bufs);
}
diff --git a/usr/src/cmd/fm/fmd/common/fmd_scheme.c b/usr/src/cmd/fm/fmd/common/fmd_scheme.c
index 4ddad713a6..367ecde455 100644
--- a/usr/src/cmd/fm/fmd/common/fmd_scheme.c
+++ b/usr/src/cmd/fm/fmd/common/fmd_scheme.c
@@ -142,21 +142,38 @@ fmd_scheme_fmd_unusable(nvlist_t *nvl)
return (rv);
}
-/*ARGSUSED*/
static nvlist_t *
-fmd_scheme_notranslate(nvlist_t *fmri, nvlist_t *auth)
+fmd_scheme_notranslate(nvlist_t *fmri, nvlist_t *auth __unused)
{
(void) nvlist_xdup(fmri, &fmri, &fmd.d_nva);
return (fmri);
}
-static long
-fmd_scheme_notsup(void)
+static ssize_t
+fmd_scheme_notsup_nvl2str(nvlist_t *fmri __unused, char *arg1 __unused,
+ size_t arg2 __unused)
+{
+ return (fmd_set_errno(EFMD_FMRI_NOTSUP));
+}
+
+static int
+fmd_scheme_notsup(nvlist_t *fmri __unused)
{
return (fmd_set_errno(EFMD_FMRI_NOTSUP));
}
static int
+fmd_scheme_notsup2(nvlist_t *fmri1 __unused, nvlist_t *fmri2 __unused)
+{
+ return (fmd_set_errno(EFMD_FMRI_NOTSUP));
+}
+
+static void
+fmd_scheme_vnop(void)
+{
+}
+
+static int
fmd_scheme_nop(void)
{
return (0);
@@ -167,29 +184,29 @@ fmd_scheme_nop(void)
* the module, then this operation is implemented using the default function.
*/
static const fmd_scheme_ops_t _fmd_scheme_default_ops = {
- (int (*)())fmd_scheme_nop, /* sop_init */
- (void (*)())fmd_scheme_nop, /* sop_fini */
- (ssize_t (*)())fmd_scheme_notsup, /* sop_nvl2str */
- (int (*)())fmd_scheme_nop, /* sop_expand */
- (int (*)())fmd_scheme_notsup, /* sop_present */
- (int (*)())fmd_scheme_notsup, /* sop_replaced */
- (int (*)())fmd_scheme_notsup, /* sop_service_state */
- (int (*)())fmd_scheme_notsup, /* sop_unusable */
- (int (*)())fmd_scheme_notsup, /* sop_contains */
- fmd_scheme_notranslate /* sop_translate */
+ .sop_init = fmd_scheme_nop,
+ .sop_fini = fmd_scheme_vnop,
+ .sop_nvl2str = fmd_scheme_notsup_nvl2str,
+ .sop_expand = fmd_scheme_notsup,
+ .sop_present = fmd_scheme_notsup,
+ .sop_replaced = fmd_scheme_notsup,
+ .sop_service_state = fmd_scheme_notsup,
+ .sop_unusable = fmd_scheme_notsup,
+ .sop_contains = fmd_scheme_notsup2,
+ .sop_translate = fmd_scheme_notranslate
};
static const fmd_scheme_ops_t _fmd_scheme_builtin_ops = {
- (int (*)())fmd_scheme_nop, /* sop_init */
- (void (*)())fmd_scheme_nop, /* sop_fini */
- fmd_scheme_fmd_nvl2str, /* sop_nvl2str */
- (int (*)())fmd_scheme_nop, /* sop_expand */
- fmd_scheme_fmd_present, /* sop_present */
- fmd_scheme_fmd_replaced, /* sop_replaced */
- fmd_scheme_fmd_service_state, /* sop_service_state */
- fmd_scheme_fmd_unusable, /* sop_unusable */
- (int (*)())fmd_scheme_notsup, /* sop_contains */
- fmd_scheme_notranslate /* sop_translate */
+ .sop_init = fmd_scheme_nop,
+ .sop_fini = fmd_scheme_vnop,
+ .sop_nvl2str = fmd_scheme_fmd_nvl2str,
+ .sop_expand = fmd_scheme_notsup,
+ .sop_present = fmd_scheme_fmd_present,
+ .sop_replaced = fmd_scheme_fmd_replaced,
+ .sop_service_state = fmd_scheme_fmd_service_state,
+ .sop_unusable = fmd_scheme_fmd_unusable,
+ .sop_contains = fmd_scheme_notsup2,
+ .sop_translate = fmd_scheme_notranslate
};
/*
diff --git a/usr/src/cmd/fm/fmd/common/fmd_serd.c b/usr/src/cmd/fm/fmd/common/fmd_serd.c
index 166b565666..0c817ef07d 100644
--- a/usr/src/cmd/fm/fmd/common/fmd_serd.c
+++ b/usr/src/cmd/fm/fmd/common/fmd_serd.c
@@ -24,8 +24,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <fmd_alloc.h>
#include <fmd_string.h>
#include <fmd_subr.h>
@@ -189,8 +187,9 @@ fmd_serd_eng_contains(fmd_serd_eng_t *sgp, fmd_event_t *ep)
}
int
-fmd_serd_eng_record(fmd_serd_eng_t *sgp, fmd_event_t *ep)
+fmd_serd_eng_record(void *ptr, fmd_event_t *ep)
{
+ fmd_serd_eng_t *sgp = ptr;
fmd_serd_elem_t *sep, *oep;
/*
@@ -253,7 +252,7 @@ fmd_serd_eng_reset(fmd_serd_eng_t *sgp)
}
void
-fmd_serd_eng_gc(fmd_serd_eng_t *sgp)
+fmd_serd_eng_gc(fmd_serd_eng_t *sgp, void *arg __unused)
{
fmd_serd_elem_t *sep, *nep;
hrtime_t hrt;
@@ -275,7 +274,7 @@ fmd_serd_eng_gc(fmd_serd_eng_t *sgp)
}
void
-fmd_serd_eng_commit(fmd_serd_eng_t *sgp)
+fmd_serd_eng_commit(fmd_serd_eng_t *sgp, void *arg __unused)
{
fmd_serd_elem_t *sep;
@@ -290,7 +289,7 @@ fmd_serd_eng_commit(fmd_serd_eng_t *sgp)
}
void
-fmd_serd_eng_clrdirty(fmd_serd_eng_t *sgp)
+fmd_serd_eng_clrdirty(fmd_serd_eng_t *sgp, void *arg __unused)
{
sgp->sg_flags &= ~FMD_SERD_DIRTY;
}
diff --git a/usr/src/cmd/fm/fmd/common/fmd_serd.h b/usr/src/cmd/fm/fmd/common/fmd_serd.h
index 3841f91999..48190a9058 100644
--- a/usr/src/cmd/fm/fmd/common/fmd_serd.h
+++ b/usr/src/cmd/fm/fmd/common/fmd_serd.h
@@ -27,8 +27,6 @@
#ifndef _FMD_SERD_H
#define _FMD_SERD_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -75,14 +73,14 @@ extern fmd_serd_eng_t *fmd_serd_eng_lookup(fmd_serd_hash_t *, const char *);
extern void fmd_serd_eng_delete(fmd_serd_hash_t *, const char *);
extern int fmd_serd_eng_contains(fmd_serd_eng_t *, fmd_event_t *);
-extern int fmd_serd_eng_record(fmd_serd_eng_t *, fmd_event_t *);
+extern int fmd_serd_eng_record(void *, fmd_event_t *);
extern int fmd_serd_eng_fired(fmd_serd_eng_t *);
extern int fmd_serd_eng_empty(fmd_serd_eng_t *);
extern void fmd_serd_eng_reset(fmd_serd_eng_t *);
-extern void fmd_serd_eng_gc(fmd_serd_eng_t *);
-extern void fmd_serd_eng_commit(fmd_serd_eng_t *);
-extern void fmd_serd_eng_clrdirty(fmd_serd_eng_t *);
+extern void fmd_serd_eng_gc(fmd_serd_eng_t *, void *);
+extern void fmd_serd_eng_commit(fmd_serd_eng_t *, void*);
+extern void fmd_serd_eng_clrdirty(fmd_serd_eng_t *, void*);
#ifdef __cplusplus
}
diff --git a/usr/src/cmd/fm/fmd/common/fmd_thread.c b/usr/src/cmd/fm/fmd/common/fmd_thread.c
index cb0cb0745d..5de69238b5 100644
--- a/usr/src/cmd/fm/fmd/common/fmd_thread.c
+++ b/usr/src/cmd/fm/fmd/common/fmd_thread.c
@@ -41,7 +41,7 @@ fmd_thread_xcreate(fmd_module_t *mp, pthread_t tid)
tp->thr_func = NULL;
tp->thr_arg = NULL;
tp->thr_trdata = fmd_trace_create();
- tp->thr_trfunc = (fmd_tracebuf_f *)fmd.d_thr_trace;
+ tp->thr_trfunc = fmd.d_thr_trace;
tp->thr_errdepth = 0;
tp->thr_isdoor = 0;
@@ -81,7 +81,7 @@ fmd_thread_create_cmn(fmd_module_t *mp, fmd_thread_f *func, void *arg,
tp->thr_func = func;
tp->thr_arg = arg;
tp->thr_trdata = fmd_trace_create();
- tp->thr_trfunc = (fmd_tracebuf_f *)fmd.d_thr_trace;
+ tp->thr_trfunc = fmd.d_thr_trace;
tp->thr_errdepth = 0;
tp->thr_isdoor = isdoor;
diff --git a/usr/src/cmd/fm/fmd/common/fmd_time.c b/usr/src/cmd/fm/fmd/common/fmd_time.c
index ace772a476..a735ba03bf 100644
--- a/usr/src/cmd/fm/fmd/common/fmd_time.c
+++ b/usr/src/cmd/fm/fmd/common/fmd_time.c
@@ -186,7 +186,7 @@ fmd_time_tod2hrt(hrtime_t hrt_base, const fmd_timeval_t *tod_base,
* period between 'hrt' and 't0', therefore to check which one came first, we
* test their subtraction against the highest bit of mask, if the bit is not
* set, then 't0' is earlier. This is equivalent to
- * ((hrt - t0) & mask) < ((mask + 1) / 2)
+ * ((hrt - t0) & mask) < ((mask + 1) / 2)
*/
hrtime_t
fmd_time_ena2hrt(hrtime_t hrt, uint64_t ena)
@@ -366,6 +366,11 @@ fmd_native_cancel(pthread_t tid)
(void) pthread_kill(tid, SIGALRM);
}
+static void
+fmd_time_vnop(void)
+{
+}
+
static void *
fmd_time_nop(void)
{
@@ -374,10 +379,10 @@ fmd_time_nop(void)
const fmd_timeops_t fmd_timeops_native = {
(void *(*)())fmd_time_nop, /* fto_init */
- (void (*)())fmd_time_nop, /* fto_fini */
+ (void (*)())fmd_time_vnop, /* fto_fini */
gettimeofday, /* fto_gettimeofday */
gethrtime, /* fto_gethrtime */
- (void (*)())fmd_time_nop, /* fto_addhrtime */
+ (void (*)())fmd_time_vnop, /* fto_addhrtime */
fmd_native_wait, /* fto_waithrtime */
fmd_native_cancel, /* fto_waitcancel */
};
diff --git a/usr/src/cmd/fm/fmdump/common/scheme.c b/usr/src/cmd/fm/fmdump/common/scheme.c
index 425fbd302c..20cad01a50 100644
--- a/usr/src/cmd/fm/fmdump/common/scheme.c
+++ b/usr/src/cmd/fm/fmdump/common/scheme.c
@@ -23,8 +23,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/types.h>
#include <sys/systeminfo.h>
@@ -79,6 +77,11 @@ fmd_scheme_notsup(void)
return (-1);
}
+static void
+fmd_scheme_vnop(void)
+{
+}
+
static int
fmd_scheme_nop(void)
{
@@ -91,7 +94,7 @@ fmd_scheme_nop(void)
*/
static const fmd_scheme_ops_t _fmd_scheme_default_ops = {
(int (*)())fmd_scheme_nop, /* sop_init */
- (void (*)())fmd_scheme_nop, /* sop_fini */
+ (void (*)())fmd_scheme_vnop, /* sop_fini */
(ssize_t (*)())fmd_scheme_notsup, /* sop_nvl2str */
};
diff --git a/usr/src/lib/fm/libfmd_snmp/common/module.c b/usr/src/lib/fm/libfmd_snmp/common/module.c
index 6f6161f366..0521cf40fb 100644
--- a/usr/src/lib/fm/libfmd_snmp/common/module.c
+++ b/usr/src/lib/fm/libfmd_snmp/common/module.c
@@ -270,9 +270,8 @@ modinfo_update(sunFmModule_update_ctx_t *update_ctx)
return (SNMP_ERR_NOERROR);
}
-/*ARGSUSED*/
-static void
-update_thread(void *arg)
+__NORETURN static void *
+update_thread(void *arg __unused)
{
/*
* The current modinfo_update implementation offers minimal savings
@@ -357,8 +356,7 @@ sunFmModuleTable_init(void)
return (MIB_REGISTRATION_FAILED);
}
- if ((err = pthread_create(NULL, NULL, (void *(*)(void *))update_thread,
- NULL)) != 0) {
+ if ((err = pthread_create(NULL, NULL, update_thread, NULL)) != 0) {
(void) snmp_log(LOG_ERR, MODNAME_STR ": error creating update "
"thread: %s\n", strerror(err));
return (MIB_REGISTRATION_FAILED);
diff --git a/usr/src/lib/fm/libfmd_snmp/common/problem.c b/usr/src/lib/fm/libfmd_snmp/common/problem.c
index dc1fc7a158..21835ec8a0 100644
--- a/usr/src/lib/fm/libfmd_snmp/common/problem.c
+++ b/usr/src/lib/fm/libfmd_snmp/common/problem.c
@@ -274,9 +274,8 @@ problem_update(sunFmProblem_update_ctx_t *update_ctx)
return (SNMP_ERR_NOERROR);
}
-/*ARGSUSED*/
-static void
-update_thread(void *arg)
+__NORETURN static void *
+update_thread(void *arg __unused)
{
/*
* The current problem_update implementation offers minimal savings
@@ -348,8 +347,7 @@ sunFmProblemTable_init(void)
return (MIB_REGISTRATION_FAILED);
}
- if ((err = pthread_create(NULL, NULL, (void *(*)(void *))update_thread,
- NULL)) != 0) {
+ if ((err = pthread_create(NULL, NULL, update_thread, NULL)) != 0) {
(void) snmp_log(LOG_ERR, MODNAME_STR ": error creating update "
"thread: %s\n", strerror(err));
return (MIB_REGISTRATION_FAILED);
diff --git a/usr/src/lib/fm/libfmd_snmp/common/resource.c b/usr/src/lib/fm/libfmd_snmp/common/resource.c
index 59e202337e..7cf3e1131c 100644
--- a/usr/src/lib/fm/libfmd_snmp/common/resource.c
+++ b/usr/src/lib/fm/libfmd_snmp/common/resource.c
@@ -265,9 +265,8 @@ rsrcinfo_update(sunFmResource_update_ctx_t *update_ctx)
return (SNMP_ERR_NOERROR);
}
-/*ARGSUSED*/
-static void
-update_thread(void *arg)
+__NORETURN static void *
+update_thread(void *arg __unused)
{
/*
* The current rsrcinfo_update implementation offers minimal savings
@@ -354,8 +353,7 @@ sunFmResourceTable_init(void)
return (MIB_REGISTRATION_FAILED);
}
- if ((err = pthread_create(NULL, NULL, (void *(*)(void *))update_thread,
- NULL)) != 0) {
+ if ((err = pthread_create(NULL, NULL, update_thread, NULL)) != 0) {
(void) snmp_log(LOG_ERR, MODNAME_STR ": error creating update "
"thread: %s\n", strerror(err));
return (MIB_REGISTRATION_FAILED);
diff --git a/usr/src/lib/fm/libfmd_snmp/common/scheme.c b/usr/src/lib/fm/libfmd_snmp/common/scheme.c
index 55c45a7ae3..771763f6d1 100644
--- a/usr/src/lib/fm/libfmd_snmp/common/scheme.c
+++ b/usr/src/lib/fm/libfmd_snmp/common/scheme.c
@@ -24,8 +24,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/fm/protocol.h>
#include <sys/types.h>
#include <sys/systeminfo.h>
@@ -75,13 +73,19 @@ static fmd_scheme_t *sch_list; /* list of cached schemes */
static char *g_root; /* fmd root dir */
static struct topo_hdl *g_thp;
-static long
-fmd_scheme_notsup(void)
+static ssize_t
+fmd_scheme_notsup(nvlist_t *nv __unused, char *arg1 __unused,
+ size_t arg2 __unused)
{
errno = ENOTSUP;
return (-1);
}
+static void
+fmd_scheme_vnop(void)
+{
+}
+
static int
fmd_scheme_nop(void)
{
@@ -93,9 +97,9 @@ fmd_scheme_nop(void)
* the module, then this operation is implemented using the default function.
*/
static const fmd_scheme_ops_t _fmd_scheme_default_ops = {
- (int (*)())fmd_scheme_nop, /* sop_init */
- (void (*)())fmd_scheme_nop, /* sop_fini */
- (ssize_t (*)())fmd_scheme_notsup, /* sop_nvl2str */
+ .sop_init = fmd_scheme_nop, /* sop_init */
+ .sop_fini = fmd_scheme_vnop, /* sop_fini */
+ .sop_nvl2str = fmd_scheme_notsup /* sop_nvl2str */
};
/*