diff options
author | Toomas Soome <tsoome@me.com> | 2020-01-31 14:25:16 +0200 |
---|---|---|
committer | Toomas Soome <tsoome@me.com> | 2020-05-10 10:13:10 +0300 |
commit | f23a396b6eea5efd75ad61ab78e31f55a36732a8 (patch) | |
tree | 2d4fd00e305bfde868a8f626dad9a03e00d40c86 /usr/src/uts/sun4u | |
parent | 8adb60c2f39cd295bca28a5a44fa9c4934109e61 (diff) | |
download | illumos-gate-f23a396b6eea5efd75ad61ab78e31f55a36732a8.tar.gz |
12620 littleneck: NULL pointer errors
Reviewed by: Gergő Doma <domag02@gmail.com>
Reviewed by: C Fraire <cfraire@me.com>
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Approved by: Gordon Ross <gordon.w.ross@gmail.com>
Diffstat (limited to 'usr/src/uts/sun4u')
-rw-r--r-- | usr/src/uts/sun4u/littleneck/Makefile | 24 | ||||
-rw-r--r-- | usr/src/uts/sun4u/littleneck/io/pcf8574_lneck.c | 32 | ||||
-rw-r--r-- | usr/src/uts/sun4u/littleneck/os/littleneck.c | 6 |
3 files changed, 20 insertions, 42 deletions
diff --git a/usr/src/uts/sun4u/littleneck/Makefile b/usr/src/uts/sun4u/littleneck/Makefile index 134c28b1d8..c6c7ba37e0 100644 --- a/usr/src/uts/sun4u/littleneck/Makefile +++ b/usr/src/uts/sun4u/littleneck/Makefile @@ -23,8 +23,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# # This makefile drives the production of all Littleneck system # dependent modules for the sun4u architecture. # @@ -45,12 +43,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 # @@ -58,11 +52,9 @@ check := TARGET= check # .KEEP_STATE: -def all clean.lint clean clobber modlist: $(LITTLENECK_KMODS) - -modlintlib: $(LITTLENECK_KMODS) +def all clean clobber modlist: $(LITTLENECK_KMODS) -install: $(ROOT_LITTLENECK_DIR) $(USR_LITTLENECK_DIR) \ +install: $(ROOT_LITTLENECK_DIR) $(USR_LITTLENECK_DIR) \ $(USR_LITTLENECK_INC_DIR) \ $(USR_LITTLENECK_SBIN_DIR) \ $(USR_LITTLENECK_LIB_DIR) \ @@ -71,18 +63,6 @@ install: $(ROOT_LITTLENECK_DIR) $(USR_LITTLENECK_DIR) \ install_h check: -lint: modlintlib - -LINT_LIBS = $(LINT_LIB) \ - -L$(LITTLENECK_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) "\nLittleneck Platform-dependent module: global crosschecks:" - @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2) - $(LITTLENECK_KMODS): FRC @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET) diff --git a/usr/src/uts/sun4u/littleneck/io/pcf8574_lneck.c b/usr/src/uts/sun4u/littleneck/io/pcf8574_lneck.c index 8b0bcd007e..767d2a4f24 100644 --- a/usr/src/uts/sun4u/littleneck/io/pcf8574_lneck.c +++ b/usr/src/uts/sun4u/littleneck/io/pcf8574_lneck.c @@ -229,18 +229,18 @@ pcf8574_close(dev_t dev, int flags, int otyp, cred_t *credp) } static int -pcf8574_get(struct pcf8574_unit *unitp, uchar_t *byte) { +pcf8574_get(struct pcf8574_unit *unitp, uchar_t *byte) +{ i2c_transfer_t *i2c_tran_pointer; int err = I2C_SUCCESS; D1CMN_ERR((CE_WARN, "Entered the pcf8574_get routine\n")); (void) i2c_transfer_alloc(unitp->pcf8574_hdl, &i2c_tran_pointer, - 0, 1, I2C_SLEEP); + 0, 1, I2C_SLEEP); if (i2c_tran_pointer == NULL) { D2CMN_ERR((CE_WARN, "%s: Failed in pcf8574_get " - "i2c_tran_pointer not allocated\n", - unitp->pcf8574_name)); + "i2c_tran_pointer not allocated\n", unitp->pcf8574_name)); return (ENOMEM); } @@ -249,13 +249,13 @@ pcf8574_get(struct pcf8574_unit *unitp, uchar_t *byte) { err = i2c_transfer(unitp->pcf8574_hdl, i2c_tran_pointer); if (err) { D2CMN_ERR((CE_WARN, "%s: Failed in the i2c_transfer routine\n", - unitp->pcf8574_name)); + unitp->pcf8574_name)); i2c_transfer_free(unitp->pcf8574_hdl, i2c_tran_pointer); return (err); } D1CMN_ERR((CE_WARN, "Back from a transfer value is %x\n", - i2c_tran_pointer->i2c_rbuf[0])); + i2c_tran_pointer->i2c_rbuf[0])); *byte = i2c_tran_pointer->i2c_rbuf[0]; i2c_transfer_free(unitp->pcf8574_hdl, i2c_tran_pointer); @@ -263,16 +263,17 @@ pcf8574_get(struct pcf8574_unit *unitp, uchar_t *byte) { } static int -pcf8574_set(struct pcf8574_unit *unitp, uchar_t byte) { +pcf8574_set(struct pcf8574_unit *unitp, uchar_t byte) +{ i2c_transfer_t *i2c_tran_pointer; int err = I2C_SUCCESS; (void) i2c_transfer_alloc(unitp->pcf8574_hdl, &i2c_tran_pointer, - 1, 0, I2C_SLEEP); + 1, 0, I2C_SLEEP); if (i2c_tran_pointer == NULL) { D2CMN_ERR((CE_WARN, "%s: Failed in pcf8574_set " - "i2c_tran_pointer not allocated\n", - unitp->pcf8574_name)); + "i2c_tran_pointer not allocated\n", + unitp->pcf8574_name)); return (ENOMEM); } @@ -280,13 +281,12 @@ pcf8574_set(struct pcf8574_unit *unitp, uchar_t byte) { i2c_tran_pointer->i2c_wbuf[0] = byte; D1CMN_ERR((CE_NOTE, "%s: contains %x\n", unitp->pcf8574_name, - i2c_tran_pointer->i2c_wbuf[0])); + i2c_tran_pointer->i2c_wbuf[0])); err = i2c_transfer(unitp->pcf8574_hdl, i2c_tran_pointer); if (err) { D2CMN_ERR((CE_WARN, "%s: Failed in the pcf8574_set" - " i2c_transfer routine\n", - unitp->pcf8574_name)); + " i2c_transfer routine\n", unitp->pcf8574_name)); i2c_transfer_free(unitp->pcf8574_hdl, i2c_tran_pointer); return (err); } @@ -296,7 +296,7 @@ pcf8574_set(struct pcf8574_unit *unitp, uchar_t byte) { static int pcf8574_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, - cred_t *credp, int *rvalp) + cred_t *credp, int *rvalp) { _NOTE(ARGUNUSED(credp, rvalp)) struct pcf8574_unit *unitp; @@ -306,7 +306,7 @@ pcf8574_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, i2c_port_t ioctl_port; uchar_t byte; - if (arg == NULL) { + if (arg == (intptr_t)NULL) { D2CMN_ERR((CE_WARN, "PCF8574: ioctl: arg passed in to ioctl " "= NULL\n")); err = EINVAL; @@ -523,7 +523,7 @@ pcf8574_do_attach(dev_info_t *dip) if (ddi_create_minor_node(dip, "pcf8574", S_IFCHR, instance, - "ddi_i2c:ioexp", NULL) == DDI_FAILURE) { + "ddi_i2c:ioexp", 0) == DDI_FAILURE) { cmn_err(CE_WARN, "%s ddi_create_minor_node failed for " "%s\n", unitp->pcf8574_name, "pcf8574"); ddi_soft_state_free(pcf8574soft_statep, instance); diff --git a/usr/src/uts/sun4u/littleneck/os/littleneck.c b/usr/src/uts/sun4u/littleneck/os/littleneck.c index cb299c8117..9a048efc20 100644 --- a/usr/src/uts/sun4u/littleneck/os/littleneck.c +++ b/usr/src/uts/sun4u/littleneck/os/littleneck.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/param.h> #include <sys/systm.h> #include <sys/sunddi.h> @@ -51,7 +49,7 @@ int (*p2get_mem_unum)(int, uint64_t, char *, int, int *); void startup_platform(void) { - mutex_init(&lneck_pcf8584_mutex, NULL, NULL, NULL); + mutex_init(&lneck_pcf8584_mutex, NULL, MUTEX_ADAPTIVE, NULL); } int @@ -149,7 +147,7 @@ plat_get_mem_unum(int synd_code, uint64_t flt_addr, int flt_bus_id, { if (flt_in_memory && (p2get_mem_unum != NULL)) return (p2get_mem_unum(synd_code, P2ALIGN(flt_addr, 8), - buf, buflen, lenp)); + buf, buflen, lenp)); else return (ENOTSUP); } |