summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2020-01-31 14:54:24 +0200
committerToomas Soome <tsoome@me.com>2020-05-10 10:43:03 +0300
commit50ed1c1e61e07032076ff0041b06b604754d190c (patch)
tree80b000e44b03ba3e34f40131f5638007d4afa0ba
parentbaa111a1f46457da764bd7a40234b4f9a2de1885 (diff)
downloadillumos-joyent-50ed1c1e61e07032076ff0041b06b604754d190c.tar.gz
12631 sunfire: smatch and NULL pointer errors
Reviewed by: C Fraire <cfraire@me.com> Approved by: Gordon Ross <gordon.w.ross@gmail.com>
-rw-r--r--usr/src/uts/sun4u/sunfire/Makefile28
-rw-r--r--usr/src/uts/sun4u/sunfire/io/ac.c6
-rw-r--r--usr/src/uts/sun4u/sunfire/io/fhc.c15
-rw-r--r--usr/src/uts/sun4u/sunfire/io/sysctrl.c4
-rw-r--r--usr/src/uts/sun4u/sunfire/io/sysctrl_quiesce.c4
5 files changed, 15 insertions, 42 deletions
diff --git a/usr/src/uts/sun4u/sunfire/Makefile b/usr/src/uts/sun4u/sunfire/Makefile
index ee5e425567..d3d0cfc768 100644
--- a/usr/src/uts/sun4u/sunfire/Makefile
+++ b/usr/src/uts/sun4u/sunfire/Makefile
@@ -23,8 +23,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# This makefile drives the production of the sun4u sunfire platform
# module.
#
@@ -47,12 +45,8 @@ install := TARGET= install
install_h := TARGET= install_h
clean := TARGET= clean
clobber := TARGET= clobber
-lint := TARGET= lint
-lintlib := TARGET= lintlib
-modlintlib := TARGET= modlintlib
modlist := TARGET= modlist
modlist := NO_STATE= -K $$MODSTATE$$$$
-clean.lint := TARGET= clean.lint
check := TARGET= check
#
@@ -60,11 +54,9 @@ check := TARGET= check
#
.KEEP_STATE:
-def all clean clean.lint clobber modlist: \
+def all clean clobber modlist: \
$(SUNFIRE_KMODS) $(CLOSED_SUNFIRE_KMODS)
-modlintlib: $(SUNFIRE_KMODS) $(CLOSED_SUNFIRE_KMODS)
-
IMPLEMENTED_PLATFORM = SUNW,Ultra-Enterprise
install: $(ROOT_SUNFIRE_DIR) $(USR_SUNFIRE_DIR) \
@@ -76,24 +68,6 @@ install: $(ROOT_SUNFIRE_DIR) $(USR_SUNFIRE_DIR) \
install_h check: FRC
@cd sys; pwd; $(MAKE) $(TARGET)
-lint: modlintlib
-
-#
-# The 'lint.platmod' target lints the sunfire platform module against the sun4u
-# kernel. This ends up doing all the kernel cross-checks, so it takes a couple
-# of minutes. Due to the low ROI, it's not run by default, but it's a good
-# idea to run this if you change os/sunfire.c.
-#
-LINT_LIBS = $(LINT_LIB) \
- -L$(SUNFIRE_LINT_LIB_DIR) \
- -L$(LINT_LIB_DIR) $(LINT_KMODS:%=-l%) \
- $(CLOSED_LINT_KMODS:%=-l%) \
- -L$(SPARC_LIB_DIR) $(SPARC_LINTS:%=-l%)
-
-lint.platmod: modlintlib
- @-$(ECHO) "\nSunfire Platform-dependent module: global crosschecks:"
- @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2)
-
$(SUNFIRE_KMODS): FRC
@cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
diff --git a/usr/src/uts/sun4u/sunfire/io/ac.c b/usr/src/uts/sun4u/sunfire/io/ac.c
index c19cad9264..19cf822093 100644
--- a/usr/src/uts/sun4u/sunfire/io/ac.c
+++ b/usr/src/uts/sun4u/sunfire/io/ac.c
@@ -905,8 +905,8 @@ ac_add_picN_kstats(dev_info_t *dip)
};
struct kstat_named *ac_pic_named_data;
- int event, pic;
- char pic_name[30];
+ int event, pic;
+ char pic_name[30];
int instance = ddi_get_instance(dip);
int pic_shift = 0;
@@ -918,7 +918,7 @@ ac_add_picN_kstats(dev_info_t *dip)
(void) sprintf(pic_name, "pic%d", pic); /* pic0, pic1 ... */
if ((ac_picN_ksp[pic] = kstat_create("ac",
instance, pic_name, "bus", KSTAT_TYPE_NAMED,
- AC_NUM_EVENTS + 1, NULL)) == NULL) {
+ AC_NUM_EVENTS + 1, 0)) == NULL) {
cmn_err(CE_WARN, "ac %s: kstat_create failed",
pic_name);
diff --git a/usr/src/uts/sun4u/sunfire/io/fhc.c b/usr/src/uts/sun4u/sunfire/io/fhc.c
index d47130bddc..d89eb3dfb5 100644
--- a/usr/src/uts/sun4u/sunfire/io/fhc.c
+++ b/usr/src/uts/sun4u/sunfire/io/fhc.c
@@ -245,7 +245,7 @@ short clk_danger_temp = 68; /* Clock Board Danger Temperature */
short dft_warn_temp = 60; /* default warning temp value */
short dft_danger_temp = 68; /* default danger temp value */
-short cpu_warn_temp_4x = 60; /* CPU/Memory warning temp for 400 MHZ */
+short cpu_warn_temp_4x = 60; /* CPU/Memory warning temp for 400 MHZ */
short cpu_danger_temp_4x = 68; /* CPU/Memory danger temp for 400 MHZ */
/*
@@ -398,7 +398,7 @@ static struct cb_ops fhc_cb_ops = {
nulldev, /* dump */
nulldev, /* read */
nulldev, /* write */
- nulldev, /* ioctl */
+ nulldev, /* ioctl */
nodev, /* devmap */
nodev, /* mmap */
nodev, /* segmap */
@@ -1321,7 +1321,7 @@ done:
*/
static void
fhc_remove_intr_impl(dev_info_t *dip, dev_info_t *rdip,
- ddi_intr_handle_impl_t *hdlp)
+ ddi_intr_handle_impl_t *hdlp)
{
volatile uint_t *mondo_vec_reg;
volatile uint_t tmpreg;
@@ -1490,7 +1490,7 @@ fhc_intr_ops(dev_info_t *dip, dev_info_t *rdip, ddi_intr_op_t intr_op,
*/
static int
fhc_ctlops(dev_info_t *dip, dev_info_t *rdip,
- ddi_ctl_enum_t op, void *arg, void *result)
+ ddi_ctl_enum_t op, void *arg, void *result)
{
switch (op) {
@@ -1529,7 +1529,6 @@ fhc_ctlops(dev_info_t *dip, dev_info_t *rdip,
/* ARGSUSED */
static void
fhc_xlate_intrs(ddi_intr_handle_impl_t *hdlp, uint32_t ign)
-
{
uint32_t mondo;
@@ -2384,8 +2383,8 @@ cpu_on_board(int board)
int upa_a = board << 1;
int upa_b = (board << 1) + 1;
- if ((cpunodes[upa_a].nodeid != NULL) ||
- (cpunodes[upa_b].nodeid != NULL)) {
+ if ((cpunodes[upa_a].nodeid != 0) ||
+ (cpunodes[upa_b].nodeid != 0)) {
return (1);
} else {
return (0);
@@ -3385,7 +3384,7 @@ fhc_cpu_poweron(struct cpu *cp)
static void
os_completes_shutdown(void)
{
- pfn_t pfn;
+ pfn_t pfn;
tte_t tte;
volatile uint_t *src;
volatile uint_t *dst;
diff --git a/usr/src/uts/sun4u/sunfire/io/sysctrl.c b/usr/src/uts/sun4u/sunfire/io/sysctrl.c
index 206829b2a2..16ae450198 100644
--- a/usr/src/uts/sun4u/sunfire/io/sysctrl.c
+++ b/usr/src/uts/sun4u/sunfire/io/sysctrl.c
@@ -806,7 +806,7 @@ sysctrl_attach(dev_info_t *devi, ddi_attach_cmd_t cmd)
* perform initialization to allow setting of powerfail-time
*/
if ((dip = ddi_find_devinfo("options", -1, 0)) == NULL)
- softsp->options_nodeid = (pnode_t)NULL;
+ softsp->options_nodeid = (pnode_t)0;
else
softsp->options_nodeid = (pnode_t)ddi_get_nodeid(dip);
@@ -1218,7 +1218,7 @@ sysc_pkt_fini(sysc_cfga_pkt_t *pkt, intptr_t arg, int flag)
/* ARGSUSED */
static int
sysctrl_ioctl(dev_t devt, int cmd, intptr_t arg, int flag, cred_t *cred_p,
- int *rval_p)
+ int *rval_p)
{
struct sysctrl_soft_state *softsp;
sysc_cfga_pkt_t sysc_pkt;
diff --git a/usr/src/uts/sun4u/sunfire/io/sysctrl_quiesce.c b/usr/src/uts/sun4u/sunfire/io/sysctrl_quiesce.c
index b9b091f759..86f576bf22 100644
--- a/usr/src/uts/sun4u/sunfire/io/sysctrl_quiesce.c
+++ b/usr/src/uts/sun4u/sunfire/io/sysctrl_quiesce.c
@@ -576,7 +576,7 @@ sysctrl_resume(sysc_cfga_pkt_t *pkt)
*/
if (sysc_watchdog_suspended) {
mutex_enter(&tod_lock);
- tod_ops.tod_set_watchdog_timer(
+ (void) tod_ops.tod_set_watchdog_timer(
watchdog_timeout_seconds);
mutex_exit(&tod_lock);
}
@@ -731,7 +731,7 @@ sysctrl_suspend(sysc_cfga_pkt_t *pkt)
*/
if (watchdog_activated) {
mutex_enter(&tod_lock);
- tod_ops.tod_clear_watchdog_timer();
+ (void) tod_ops.tod_clear_watchdog_timer();
mutex_exit(&tod_lock);
sysc_watchdog_suspended = 1;
} else {