diff options
author | John Levon <john.levon@joyent.com> | 2020-05-26 13:57:13 +0000 |
---|---|---|
committer | John Levon <john.levon@joyent.com> | 2020-05-26 13:57:13 +0000 |
commit | 5b2acc0949194447bba6e45a0fa44d0b5f42f208 (patch) | |
tree | 7ea9eb87bc68fee386dd39035ce715e87a0e673c /usr/src/cmd/picl/plugins/sun4v | |
parent | 8ca018083101bf1cb175869679bc123187fb1bab (diff) | |
parent | 2a1277d3064386cd5c4e372301007aa330bf1d5e (diff) | |
download | illumos-joyent-gcc9.tar.gz |
mergegcc9
Diffstat (limited to 'usr/src/cmd/picl/plugins/sun4v')
-rw-r--r-- | usr/src/cmd/picl/plugins/sun4v/lib/snmp/Makefile | 7 | ||||
-rw-r--r-- | usr/src/cmd/picl/plugins/sun4v/mdesc/Makefile | 23 | ||||
-rw-r--r-- | usr/src/cmd/picl/plugins/sun4v/mdesc/mdescplugin.c | 8 | ||||
-rw-r--r-- | usr/src/cmd/picl/plugins/sun4v/piclsbl/Makefile | 14 | ||||
-rw-r--r-- | usr/src/cmd/picl/plugins/sun4v/piclsbl/piclsbl.c | 14 | ||||
-rw-r--r-- | usr/src/cmd/picl/plugins/sun4v/pri/Makefile | 23 | ||||
-rw-r--r-- | usr/src/cmd/picl/plugins/sun4v/pri/priplugin.c | 6 | ||||
-rw-r--r-- | usr/src/cmd/picl/plugins/sun4v/snmp/Makefile | 7 | ||||
-rw-r--r-- | usr/src/cmd/picl/plugins/sun4v/snmp/snmpplugin.c | 110 | ||||
-rw-r--r-- | usr/src/cmd/picl/plugins/sun4v/snmp/snmpplugin.h | 2 |
10 files changed, 71 insertions, 143 deletions
diff --git a/usr/src/cmd/picl/plugins/sun4v/lib/snmp/Makefile b/usr/src/cmd/picl/plugins/sun4v/lib/snmp/Makefile index 8b8703a66a..8c180b0473 100644 --- a/usr/src/cmd/picl/plugins/sun4v/lib/snmp/Makefile +++ b/usr/src/cmd/picl/plugins/sun4v/lib/snmp/Makefile @@ -26,10 +26,6 @@ # Copyright 2019 Peter Tribble. # -# -# cmd/picl/plugins/sun4v/lib/snmp/Makefile -# - LIBRARY= libpiclsnmp.a VERS= .1 OBJECTS= snmplib.o pdu.o asn1.o @@ -48,7 +44,6 @@ LIBS= $(DYNLIB) ROOTLIBDIR = $(ROOT_PLATFORM)/lib -CLEANFILES= $(LINTOUT) $(LINTLIB) CLOBBERFILES += $(LIBLINKS) CPPFLAGS += -I. -I../../include -I$(SRC)/uts/sun4v @@ -73,7 +68,6 @@ all := TARGET= all install := TARGET= install clean := TARGET= clean clobber := TARGET= clobber -lint := TARGET= lint all: $(DYNLIB) $(LIBLINKS) @@ -87,7 +81,6 @@ include $(SRC)/cmd/picl/plugins/Makefile.targ include $(SRC)/lib/Makefile.targ lint : - $(LINT.c) -m $(SRCS) $(SUBDIRS): FRC @cd $@; pwd; $(MAKE) $(TARGET) diff --git a/usr/src/cmd/picl/plugins/sun4v/mdesc/Makefile b/usr/src/cmd/picl/plugins/sun4v/mdesc/Makefile index e2adc58af5..fd05cab88f 100644 --- a/usr/src/cmd/picl/plugins/sun4v/mdesc/Makefile +++ b/usr/src/cmd/picl/plugins/sun4v/mdesc/Makefile @@ -23,10 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# -# cmd/picl/plugins/sun4v/mdesc/Makefile -# + LIBRARY= libmdescplugin.a VERS= .1 @@ -48,19 +45,6 @@ include $(SRC)/cmd/picl/plugins/Makefile.com SRCS= $(OBJECTS:%.o=%.c) -LINT_SRC= ./mdescplugin.c ./init.c ./dr.c \ - ./cpu_prop_update.c ./disk_discovery.c \ - $(SRC)/common/mdesc/mdesc_findname.c \ - $(SRC)/common/mdesc/mdesc_findnodeprop.c \ - $(SRC)/common/mdesc/mdesc_fini.c \ - $(SRC)/common/mdesc/mdesc_getpropdata.c \ - $(SRC)/common/mdesc/mdesc_getpropstr.c \ - $(SRC)/common/mdesc/mdesc_getpropval.c \ - $(SRC)/common/mdesc/mdesc_init_intern.c \ - $(SRC)/common/mdesc/mdesc_nodecount.c \ - $(SRC)/common/mdesc/mdesc_rootnode.c \ - $(SRC)/common/mdesc/mdesc_scandag.c - $(OBJS_DIR)/%.o: $(SRC)/common/mdesc/%.c $(COMPILE.c) -o $@ $< $(CTFCONVERT_O) @@ -74,8 +58,6 @@ DYNFLAGS_COM = /usr/lib/picl/plugins ROOTLIBDIR = $(ROOT_PLAT_PLUGINDIR) -CLEANFILES= $(LINTOUT) $(LINTLIB) - CPPFLAGS += -I$(SRC)/common/mdesc CPPFLAGS += -I$(SRC)/uts/common/sys CPPFLAGS += -D_REENTRANT @@ -87,8 +69,6 @@ DYNFLAGS += -R$(DYNFLAGS_COM) LDLIBS += -lc -lpicltree -ldevinfo -lpicldevtree -lcfgadm -lnvpair -LINTFLAGS += -erroff=E_BAD_PTR_CAST_ALIGN -v - .KEEP_STATE: all: $(LIBS) $(LIBLINKS) @@ -103,6 +83,5 @@ include $(SRC)/cmd/picl/plugins/Makefile.targ include $(SRC)/lib/Makefile.targ lint : - $(LINT.c) $(LINT_SRC) FRC: diff --git a/usr/src/cmd/picl/plugins/sun4v/mdesc/mdescplugin.c b/usr/src/cmd/picl/plugins/sun4v/mdesc/mdescplugin.c index f02c7af356..08c203a7f7 100644 --- a/usr/src/cmd/picl/plugins/sun4v/mdesc/mdescplugin.c +++ b/usr/src/cmd/picl/plugins/sun4v/mdesc/mdescplugin.c @@ -112,7 +112,7 @@ dr_handler(const char *ename, const void *earg, size_t size, void *cookie) return; } - if (nvlist_unpack((char *)earg, size, &nvlp, NULL)) { + if (nvlist_unpack((char *)earg, size, &nvlp, 0)) { return; } @@ -176,13 +176,13 @@ dsc_handler(const char *ename, const void *earg, size_t size, void *cookie) * retrieve the device's physical path from the event arg * and determine which disk (if any) we are working with */ - if (nvlist_unpack((char *)earg, size, &nvlp, NULL)) + if (nvlist_unpack((char *)earg, size, &nvlp, 0)) return; if (nvlist_lookup_string(nvlp, "devfs-path", &path)) return; lookup.path = strdup(path); - lookup.disk = NULL; + lookup.disk = 0; lookup.result = DISK_NOT_FOUND; status = ptree_walk_tree_by_class(root_node, "disk", (void *)&lookup, @@ -218,7 +218,7 @@ signal_devtree(void) size_t nvl_size; int status; - if (nvlist_alloc(&nvl, NV_UNIQUE_NAME_TYPE, NULL) != 0) + if (nvlist_alloc(&nvl, NV_UNIQUE_NAME_TYPE, 0) != 0) return; /* diff --git a/usr/src/cmd/picl/plugins/sun4v/piclsbl/Makefile b/usr/src/cmd/picl/plugins/sun4v/piclsbl/Makefile index 92077496f7..e6b0cf842f 100644 --- a/usr/src/cmd/picl/plugins/sun4v/piclsbl/Makefile +++ b/usr/src/cmd/picl/plugins/sun4v/piclsbl/Makefile @@ -22,9 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# -# cmd/picl/plugins/sun4v/piclsbl/Makefile LIBRARY= libpiclsbl.a VERS= .1 @@ -39,16 +36,10 @@ include $(SRC)/cmd/picl/plugins/Makefile.com SRCS= $(OBJECTS:%.o=%.c) -LINT_SRC= $(LINTLIB:%.ln=%) - $(OBJS_DIR)/%.o: $(SRC)/sun4v/piclsbl/%.c $(COMPILE.c) -o $@ $< $(CTFCONVERT_O) -$(LINTS_DIR)/%.ln: $(SRC)/sun4v/piclsbl/%.c - @($(LHEAD) $(LINT.c) $< $(LTAIL)) - - LIBS = $(DYNLIB) ROOT_PLATFORM = $(USR_PLAT_DIR)/sun4v @@ -57,8 +48,6 @@ DYNFLAGS_SUN4V = /usr/platform/sun4v/lib/picl/plugins DYNFLAGS_COM = /usr/lib/picl/plugins ROOTLIBDIR = $(ROOT_PLAT_PLUGINDIR) -CLEANFILES= $(LINTOUT) $(LINTLIB) - CPPFLAGS += -I$(SRC)/sun4v/piclsbl CPPFLAGS += -I$(SRC)/uts/common/sys CPPFLAGS += -I$(SRC)/lib/libpcp/common @@ -71,8 +60,6 @@ DYNFLAGS += -R$(DYNFLAGS_COM) LDLIBS += -lc -lpicltree -lumem -lnvpair -LINTFLAGS += -erroff=E_BAD_PTR_CAST_ALIGN -v - .KEEP_STATE: all: $(LIBS) $(LIBLINKS) @@ -90,6 +77,5 @@ include $(SRC)/cmd/picl/plugins/Makefile.targ include $(SRC)/lib/Makefile.targ lint : - $(LINT.c) $(SRCS) FRC: diff --git a/usr/src/cmd/picl/plugins/sun4v/piclsbl/piclsbl.c b/usr/src/cmd/picl/plugins/sun4v/piclsbl/piclsbl.c index e70ea55d54..4d4e3233f4 100644 --- a/usr/src/cmd/picl/plugins/sun4v/piclsbl/piclsbl.c +++ b/usr/src/cmd/picl/plugins/sun4v/piclsbl/piclsbl.c @@ -192,12 +192,12 @@ check_raid(int target) /* * Ontario SBL event handler, subscribed to: - * PICLEVENT_SYSEVENT_DEVICE_ADDED - * PICLEVENT_SYSEVENT_DEVICE_REMOVED + * PICLEVENT_SYSEVENT_DEVICE_ADDED + * PICLEVENT_SYSEVENT_DEVICE_REMOVED */ static void piclsbl_handler(const char *ename, const void *earg, size_t size, - void *cookie) + void *cookie) { char *devfs_path; char hdd_location[PICL_PROPNAMELEN_MAX]; @@ -236,7 +236,7 @@ piclsbl_handler(const char *ename, const void *earg, size_t size, /* * retrieve the device's physical path from the event payload */ - if (nvlist_unpack((char *)earg, size, &nvlp, NULL)) + if (nvlist_unpack((char *)earg, size, &nvlp, 0)) goto sbl_return; if (nvlist_lookup_string(nvlp, "devfs-path", &devfs_path)) goto sbl_return; @@ -248,7 +248,7 @@ piclsbl_handler(const char *ename, const void *earg, size_t size, * otherwise, return as it is not one of our disks. */ lookup.path = strdup(devfs_path); - lookup.disk = NULL; + lookup.disk = 0; lookup.result = DISK_NOT_FOUND; /* first, find the disk */ @@ -315,7 +315,7 @@ piclsbl_handler(const char *ename, const void *earg, size_t size, * populate the message for libpcp */ send_msg.msg_type = PCP_SBL_CONTROL; - send_msg.sub_type = NULL; + send_msg.sub_type = 0; send_msg.msg_len = sizeof (pcp_sbl_req_t); send_msg.msg_data = (uint8_t *)req_ptr; @@ -387,7 +387,7 @@ piclsbl_init(void) return; /* retrieve the root node for lookups in the event handler */ - if ((ptree_get_root(&root_node)) != NULL) + if ((ptree_get_root(&root_node)) != 0) return; /* load libpcp */ diff --git a/usr/src/cmd/picl/plugins/sun4v/pri/Makefile b/usr/src/cmd/picl/plugins/sun4v/pri/Makefile index afec140c72..6b67dec843 100644 --- a/usr/src/cmd/picl/plugins/sun4v/pri/Makefile +++ b/usr/src/cmd/picl/plugins/sun4v/pri/Makefile @@ -23,10 +23,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# -# cmd/picl/plugins/sun4v/pri/Makefile -# + LIBRARY= libpriplugin.a VERS= .1 @@ -48,19 +45,6 @@ include $(SRC)/cmd/picl/plugins/Makefile.com SRCS= $(OBJECTS:%.o=%.c) -LINT_SRC= ./priplugin.c ./init.c \ - ./mem_prop_update.c io_dev_label.c \ - $(SRC)/common/mdesc/mdesc_findname.c \ - $(SRC)/common/mdesc/mdesc_findnodeprop.c \ - $(SRC)/common/mdesc/mdesc_fini.c \ - $(SRC)/common/mdesc/mdesc_getpropdata.c \ - $(SRC)/common/mdesc/mdesc_getpropstr.c \ - $(SRC)/common/mdesc/mdesc_getpropval.c \ - $(SRC)/common/mdesc/mdesc_init_intern.c \ - $(SRC)/common/mdesc/mdesc_nodecount.c \ - $(SRC)/common/mdesc/mdesc_rootnode.c \ - $(SRC)/common/mdesc/mdesc_scandag.c - $(OBJS_DIR)/%.o: $(SRC)/common/mdesc/%.c $(COMPILE.c) -o $@ $< $(CTFCONVERT_O) @@ -74,8 +58,6 @@ DYNFLAGS_COM = /usr/lib/picl/plugins ROOTLIBDIR = $(ROOT_PLAT_PLUGINDIR) -CLEANFILES = $(LINTOUT) $(LINTLIB) - CPPFLAGS += -I$(SRC)/common/mdesc CPPFLAGS += -I$(SRC)/uts/common/sys CPPFLAGS += -I$(SRC)/lib/libpri/common @@ -99,8 +81,6 @@ $(SPARC_BLD)LDLIBS += -R$(DYNFLAGS_PLAT) \ -R$(DYNFLAGS_SUN4V) LDLIBS += -R$(DYNFLAGS_COM) -LINTFLAGS += -erroff=E_BAD_PTR_CAST_ALIGN -v - .KEEP_STATE: all: $(LIBS) $(LIBLINKS) @@ -115,6 +95,5 @@ include $(SRC)/cmd/picl/plugins/Makefile.targ include $(SRC)/lib/Makefile.targ lint : - $(LINT.c) $(LINT_SRC) FRC: diff --git a/usr/src/cmd/picl/plugins/sun4v/pri/priplugin.c b/usr/src/cmd/picl/plugins/sun4v/pri/priplugin.c index 7ef1bad438..13bf878af8 100644 --- a/usr/src/cmd/picl/plugins/sun4v/pri/priplugin.c +++ b/usr/src/cmd/picl/plugins/sun4v/pri/priplugin.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <pri.h> #include "priplugin.h" @@ -126,14 +124,14 @@ priplugin_init(void) (void) mutex_init(&rebuild_lock, USYNC_THREAD, NULL); (void) cond_init(&rebuild_cv, USYNC_THREAD, NULL); - if ((status = thr_create(NULL, NULL, pri_worker_thread, NULL, THR_BOUND, + if ((status = thr_create(NULL, 0, pri_worker_thread, NULL, THR_BOUND, &pri_worker_thread_id)) < 0) { pri_debug(LOG_NOTICE, "priplugin: can't create worker thread: " "%d\n", status); all_thr_exit = B_TRUE; (void) mutex_destroy(&rebuild_lock); (void) cond_destroy(&rebuild_cv); - } else if ((status = thr_create(NULL, NULL, pri_reader_thread, NULL, + } else if ((status = thr_create(NULL, 0, pri_reader_thread, NULL, THR_BOUND, &pri_reader_thread_id)) < 0) { pri_debug(LOG_NOTICE, "priplugin: can't create reader thread: " "%d\n", status); diff --git a/usr/src/cmd/picl/plugins/sun4v/snmp/Makefile b/usr/src/cmd/picl/plugins/sun4v/snmp/Makefile index 66f24fd4a8..83a0c8728e 100644 --- a/usr/src/cmd/picl/plugins/sun4v/snmp/Makefile +++ b/usr/src/cmd/picl/plugins/sun4v/snmp/Makefile @@ -23,10 +23,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# -# cmd/picl/plugins/sun4v/snmp/Makefile -# LIBRARY= libsnmpplugin.a VERS= .1 @@ -45,8 +41,6 @@ LIBS = $(DYNLIB) ROOT_PLATFORM = $(USR_PLAT_DIR)/sun4v ROOTLIBDIR = $(ROOT_PLAT_PLUGINDIR) -CLEANFILES= $(LINTOUT) $(LINTLIB) - CPPFLAGS += -I. -I../include -I$(SRC)/uts/common/sys CPPFLAGS += -D_REENTRANT @@ -92,6 +86,5 @@ include $(SRC)/cmd/picl/plugins/Makefile.targ include $(SRC)/lib/Makefile.targ lint : - $(LINT.c) $(SRCS) FRC: diff --git a/usr/src/cmd/picl/plugins/sun4v/snmp/snmpplugin.c b/usr/src/cmd/picl/plugins/sun4v/snmp/snmpplugin.c index 62e97e1a00..767c7f7514 100644 --- a/usr/src/cmd/picl/plugins/sun4v/snmp/snmpplugin.c +++ b/usr/src/cmd/picl/plugins/sun4v/snmp/snmpplugin.c @@ -332,7 +332,7 @@ snmpplugin_init(void) * Create the tree-builder thread and let it take over */ LOGPRINTF("Tree-builder thread being created.\n"); - if ((ret = thr_create(NULL, NULL, tree_builder, NULL, + if ((ret = thr_create(NULL, 0, tree_builder, NULL, THR_BOUND, &tree_builder_thr_id)) < 0) { log_msg(LOG_ERR, SNMPP_CANT_CREATE_TREE_BUILDER, ret); snmp_fini(hdl); @@ -356,7 +356,7 @@ snmpplugin_init(void) cache_refresh_thr_exit = B_FALSE; LOGPRINTF("Cache refresher thread being created.\n"); - if (thr_create(NULL, NULL, cache_refresher, NULL, THR_BOUND, + if (thr_create(NULL, 0, cache_refresher, NULL, THR_BOUND, &cache_refresh_thr_id) < 0) { (void) cond_destroy(&cache_refresh_cv); (void) mutex_destroy(&cache_refresh_lock); @@ -489,8 +489,8 @@ tree_builder(void *arg) return (NULL); } - old_physplat_root = NULL; - physplat_root = NULL; + old_physplat_root = 0; + physplat_root = 0; LOGPRINTF("tree_builder: getting root node\n"); if ((ret = ptree_get_root(&root_node)) != PICL_SUCCESS) { @@ -514,7 +514,7 @@ tree_builder(void *arg) return ((void *)-3); } - if (rv == PICL_SUCCESS && old_physplat_root != NULL) { + if (rv == PICL_SUCCESS && old_physplat_root != 0) { LOGPRINTF("tree_builder: destroying existing nodes\n"); ptree_delete_node(old_physplat_root); ptree_destroy_node(old_physplat_root); @@ -705,7 +705,7 @@ make_node(picl_nodehdl_t subtree_root, int row, int *snmp_syserr_p) /* * If we've already created this picl node, just return it */ - if ((nodeh = lookup_nodeh(row)) != NULL) + if ((nodeh = lookup_nodeh(row)) != 0) return (nodeh); /* @@ -715,13 +715,13 @@ make_node(picl_nodehdl_t subtree_root, int row, int *snmp_syserr_p) */ ret = snmp_get_int(hdl, OID_entPhysicalContainedIn, row, &parent_row, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) if (ret < 0 || parent_row <= 0) parenth = subtree_root; else { parenth = make_node(subtree_root, parent_row, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) - if (parenth == NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) + if (parenth == 0) parenth = subtree_root; } @@ -732,49 +732,49 @@ make_node(picl_nodehdl_t subtree_root, int row, int *snmp_syserr_p) */ ret = snmp_get_str(hdl, OID_entPhysicalName, row, &phys_name, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) if (ret < 0 || phys_name == NULL) { log_msg(LOG_WARNING, SNMPP_NO_ENTPHYSNAME, row); - return (NULL); + return (0); } node_name = basename(phys_name); ret = snmp_get_int(hdl, OID_entPhysicalClass, row, &ent_physclass, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) if (ret < 0) { log_msg(LOG_WARNING, SNMPP_CANT_FETCH_OBJECT_VAL, *snmp_syserr_p ? *snmp_syserr_p : ret, OID_entPhysicalClass, row); free(phys_name); - return (NULL); + return (0); } switch (ent_physclass) { case SPC_OTHER: ret = snmp_get_int(hdl, OID_sunPlatPhysicalClass, row, &sunplat_physclass, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) if (ret < 0) { log_msg(LOG_WARNING, SNMPP_CANT_FETCH_OBJECT_VAL, *snmp_syserr_p ? *snmp_syserr_p : ret, OID_sunPlatPhysicalClass, row); free(phys_name); - return (NULL); + return (0); } if (sunplat_physclass == SSPC_ALARM) { ret = snmp_get_int(hdl, OID_sunPlatAlarmType, row, &alarm_type, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) if (ret < 0) { log_msg(LOG_WARNING, SNMPP_CANT_FETCH_OBJECT_VAL, *snmp_syserr_p ? *snmp_syserr_p : ret, OID_sunPlatAlarmType, row); free(phys_name); - return (NULL); + return (0); } if (alarm_type == SSAT_VISIBLE) { @@ -785,14 +785,14 @@ make_node(picl_nodehdl_t subtree_root, int row, int *snmp_syserr_p) add_prop(nodeh, &proph, node_name, row, PP_STATE, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) } else { ADD_NODE(PICL_CLASS_OTHER) } add_prop(nodeh, &proph, node_name, row, PP_OPSTATUS, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) break; case SPC_UNKNOWN: @@ -803,14 +803,14 @@ make_node(picl_nodehdl_t subtree_root, int row, int *snmp_syserr_p) ADD_NODE(PICL_CLASS_CHASSIS) add_prop(nodeh, &proph, node_name, row, PP_OPSTATUS, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) break; case SPC_BACKPLANE: ADD_NODE(PICL_CLASS_BACKPLANE) add_prop(nodeh, &proph, node_name, row, PP_OPSTATUS, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) break; case SPC_CONTAINER: @@ -818,66 +818,66 @@ make_node(picl_nodehdl_t subtree_root, int row, int *snmp_syserr_p) add_prop(nodeh, &proph, node_name, row, PP_OPSTATUS, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) add_prop(nodeh, &proph, node_name, row, PP_SLOT_TYPE, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) break; case SPC_POWERSUPPLY: ret = snmp_get_int(hdl, OID_sunPlatPowerSupplyClass, row, &ps_class, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) if (ret < 0) { log_msg(LOG_WARNING, SNMPP_CANT_FETCH_OBJECT_VAL, *snmp_syserr_p ? *snmp_syserr_p : ret, OID_sunPlatPowerSupplyClass, row); free(phys_name); - return (NULL); + return (0); } if (ps_class == SSPSC_BATTERY) { ADD_NODE(PICL_CLASS_BATTERY) add_prop(nodeh, &proph, node_name, row, PP_BATT_STATUS, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) } else { ADD_NODE(PICL_CLASS_POWERSUPPLY) } add_prop(nodeh, &proph, node_name, row, PP_OPSTATUS, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) break; case SPC_FAN: ADD_NODE(PICL_CLASS_FAN) add_prop(nodeh, &proph, node_name, row, PP_OPSTATUS, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) break; case SPC_SENSOR: ret = snmp_get_int(hdl, OID_sunPlatSensorClass, row, &sensor_class, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) if (ret < 0) { log_msg(LOG_WARNING, SNMPP_CANT_FETCH_OBJECT_VAL, *snmp_syserr_p ? *snmp_syserr_p : ret, OID_sunPlatSensorClass, row); free(phys_name); - return (NULL); + return (0); } ret = snmp_get_int(hdl, OID_sunPlatSensorType, row, &sensor_type, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) if (ret < 0) { log_msg(LOG_WARNING, SNMPP_CANT_FETCH_OBJECT_VAL, *snmp_syserr_p ? *snmp_syserr_p : ret, OID_sunPlatSensorType, row); free(phys_name); - return (NULL); + return (0); } if (sensor_class == SSSC_NUMERIC) { @@ -902,26 +902,26 @@ make_node(picl_nodehdl_t subtree_root, int row, int *snmp_syserr_p) add_prop(nodeh, &proph, node_name, row, PP_SENSOR_VALUE, snmp_syserr_p); } - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) add_prop(nodeh, &proph, node_name, row, PP_OPSTATUS, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) add_prop(nodeh, &proph, node_name, row, PP_BASE_UNITS, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) add_prop(nodeh, &proph, node_name, row, PP_EXPONENT, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) add_prop(nodeh, &proph, node_name, row, PP_RATE_UNITS, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) add_thresholds(nodeh, row, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) } else if (sensor_class == SSSC_BINARY) { if (sensor_type == SSST_TEMPERATURE) { @@ -940,19 +940,19 @@ make_node(picl_nodehdl_t subtree_root, int row, int *snmp_syserr_p) add_prop(nodeh, &proph, node_name, row, PP_OPSTATUS, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) add_prop(nodeh, &proph, node_name, row, PP_CONDITION, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) add_prop(nodeh, &proph, node_name, row, PP_EXPECTED, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) } else { log_msg(LOG_ERR, SNMPP_UNSUPP_SENSOR_CLASS, sensor_class, row); - return (NULL); + return (0); } break; @@ -961,15 +961,15 @@ make_node(picl_nodehdl_t subtree_root, int row, int *snmp_syserr_p) add_prop(nodeh, &proph, node_name, row, PP_OPSTATUS, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) add_prop(nodeh, &proph, node_name, row, PP_REPLACEABLE, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) add_prop(nodeh, &proph, node_name, row, PP_HOTSWAPPABLE, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) break; case SPC_PORT: @@ -984,32 +984,32 @@ make_node(picl_nodehdl_t subtree_root, int row, int *snmp_syserr_p) log_msg(LOG_WARNING, SNMPP_UNKNOWN_ENTPHYSCLASS, ent_physclass, row); free(phys_name); - return (NULL); + return (0); } add_prop(nodeh, &proph, node_name, row, PP_DESCRIPTION, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) add_prop(nodeh, &proph, node_name, row, PP_LABEL, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) add_prop(nodeh, &proph, node_name, row, PP_HW_REVISION, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) add_prop(nodeh, &proph, node_name, row, PP_FW_REVISION, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) add_prop(nodeh, &proph, node_name, row, PP_SERIAL_NUM, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) add_prop(nodeh, &proph, node_name, row, PP_MFG_NAME, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) add_prop(nodeh, &proph, node_name, row, PP_MODEL_NAME, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) add_prop(nodeh, &proph, node_name, row, PP_IS_FRU, snmp_syserr_p); - CHECK_LINKRESET(snmp_syserr_p, NULL) + CHECK_LINKRESET(snmp_syserr_p, 0) free(phys_name); save_nodeh(nodeh, row); @@ -1057,7 +1057,7 @@ static picl_nodehdl_t lookup_nodeh(int row) { if (row >= n_physplat_nodes) - return (NULL); + return (0); return (physplat_nodes[row]); } diff --git a/usr/src/cmd/picl/plugins/sun4v/snmp/snmpplugin.h b/usr/src/cmd/picl/plugins/sun4v/snmp/snmpplugin.h index 8bd7d87db1..6454552b7a 100644 --- a/usr/src/cmd/picl/plugins/sun4v/snmp/snmpplugin.h +++ b/usr/src/cmd/picl/plugins/sun4v/snmp/snmpplugin.h @@ -71,7 +71,7 @@ typedef struct { if (ptree_create_and_add_node(parenth, node_name, cl, \ &nodeh) != PICL_SUCCESS) { \ log_msg(LOG_ERR, SNMPP_ADD_NODE_FAIL, node_name, cl); \ - return (NULL); \ + return (0); \ } \ } |