summaryrefslogtreecommitdiff
path: root/usr/src/lib/fm
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib/fm')
-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
-rw-r--r--usr/src/lib/fm/topo/modules/i86pc/hostbridge/hb_i86pc.c12
5 files changed, 32 insertions, 22 deletions
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 */
};
/*
diff --git a/usr/src/lib/fm/topo/modules/i86pc/hostbridge/hb_i86pc.c b/usr/src/lib/fm/topo/modules/i86pc/hostbridge/hb_i86pc.c
index b8d89db32d..8968c70c95 100644
--- a/usr/src/lib/fm/topo/modules/i86pc/hostbridge/hb_i86pc.c
+++ b/usr/src/lib/fm/topo/modules/i86pc/hostbridge/hb_i86pc.c
@@ -93,6 +93,18 @@ pci_hostbridges_find(topo_mod_t *mod, tnode_t *ptn)
pnode = di_drv_first_node(PCI, devtree);
while (pnode != DI_NODE_NIL) {
+ /*
+ * We've seen cases where certain phantom PCI hostbridges have
+ * appeared on systems. If we encounter a host bridge without a
+ * bus address assigned to it, then we should skip processing it
+ * here as that indicates that it generally doesn't have any
+ * devices under it and we'll otherwise blow up in devinfo.
+ */
+ if (di_bus_addr(pnode) == NULL) {
+ pnode = di_drv_next_node(pnode);
+ continue;
+ }
+
if (hb_process(mod, ptn, hbcnt, pnode) < 0) {
if (hbcnt == 0)
topo_node_range_destroy(ptn, HOSTBRIDGE);