diff options
author | Toomas Soome <tsoome@me.com> | 2020-02-01 09:50:38 +0200 |
---|---|---|
committer | Toomas Soome <tsoome@me.com> | 2020-05-11 21:01:00 +0300 |
commit | cb453c7ae4b42ac7a2d7ce155181572a96d69b33 (patch) | |
tree | 3e918da39b3eedb8c6d37b46a135a7ee04b30b57 /usr/src | |
parent | 29368e865707707ba77989693d34358ebfa08757 (diff) | |
download | illumos-gate-cb453c7ae4b42ac7a2d7ce155181572a96d69b33.tar.gz |
12650 ds: smatch and NULL pointer errors
Reviewed by: C Fraire <cfraire@me.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/uts/sun4v/ds/Makefile | 20 | ||||
-rw-r--r-- | usr/src/uts/sun4v/io/ds_common.c | 4 | ||||
-rw-r--r-- | usr/src/uts/sun4v/io/ds_drv.c | 8 | ||||
-rw-r--r-- | usr/src/uts/sun4v/sys/ds_impl.h | 8 |
4 files changed, 9 insertions, 31 deletions
diff --git a/usr/src/uts/sun4v/ds/Makefile b/usr/src/uts/sun4v/ds/Makefile index ed43f2f58e..f119b7138f 100644 --- a/usr/src/uts/sun4v/ds/Makefile +++ b/usr/src/uts/sun4v/ds/Makefile @@ -40,7 +40,6 @@ UTSBASE = ../.. # MODULE = ds OBJECTS = $(DS_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(DS_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_MISC_DIR)/$(MODULE) # @@ -52,15 +51,9 @@ include $(UTSBASE)/sun4v/Makefile.sun4v # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) - -# # Turn on doubleword alignment for 64 bit registers # CFLAGS += -dalign @@ -70,13 +63,6 @@ CFLAGS += -dalign # LDFLAGS += -dy -Nmisc/ldc -# -# For now, disable these lint checks; maintainers should endeavor -# to investigate and remove these for maximum lint coverage. -# Please do not carry these forward to new Makefiles. -# -LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN - CERRWARN += $(CNOWARN_UNINIT) # @@ -92,12 +78,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # diff --git a/usr/src/uts/sun4v/io/ds_common.c b/usr/src/uts/sun4v/io/ds_common.c index 54876ac3bc..fad3014d2b 100644 --- a/usr/src/uts/sun4v/io/ds_common.c +++ b/usr/src/uts/sun4v/io/ds_common.c @@ -431,7 +431,7 @@ ds_ldc_fini(ds_port_t *port) } port->ldc.id = (uint64_t)-1; - port->ldc.hdl = NULL; + port->ldc.hdl = 0; port->ldc.state = 0; return (rv); @@ -2492,7 +2492,7 @@ ds_ucap_init(ds_capability_t *cap, ds_clnt_ops_t *ops, uint32_t flags, ds_vers_check_t status; ds_svc_t *svc; int rv = 0; - ds_svc_hdl_t lb_hdl, hdl; + ds_svc_hdl_t lb_hdl, hdl; int is_loopback; int is_client; diff --git a/usr/src/uts/sun4v/io/ds_drv.c b/usr/src/uts/sun4v/io/ds_drv.c index 2b2ba29e52..b812999005 100644 --- a/usr/src/uts/sun4v/io/ds_drv.c +++ b/usr/src/uts/sun4v/io/ds_drv.c @@ -493,8 +493,6 @@ static ds_log_entry_t ds_log_entry_pool[DS_LOG_NPOOL]; static void ds_log_init(void) { - ds_log_entry_t *new; - /* initialize global lock */ mutex_init(&ds_log.lock, NULL, MUTEX_DRIVER, NULL); @@ -506,9 +504,9 @@ ds_log_init(void) ds_log.nentry = 0; /* initialize the free list */ - for (new = ds_log_entry_pool; new < DS_LOG_POOL_END; new++) { - new->next = ds_log.freelist; - ds_log.freelist = new; + for (int i = 0; i < DS_LOG_NPOOL; i++) { + ds_log_entry_pool[i].next = ds_log.freelist; + ds_log.freelist = &ds_log_entry_pool[i]; } mutex_exit(&ds_log.lock); diff --git a/usr/src/uts/sun4v/sys/ds_impl.h b/usr/src/uts/sun4v/sys/ds_impl.h index a2a06d21a3..00e8ba7680 100644 --- a/usr/src/uts/sun4v/sys/ds_impl.h +++ b/usr/src/uts/sun4v/sys/ds_impl.h @@ -196,7 +196,7 @@ typedef struct ds_port { uint32_t ver_idx; /* index of version during handshake */ ds_ldc_t ldc; /* LDC for this port */ ds_domain_hdl_t domain_hdl; /* LDOMs domain hdl assoc. with port */ - char *domain_name; /* LDOMs domain name assoc. with port */ + char *domain_name; /* LDOMs domain name assoc. with port */ } ds_port_t; #define IS_DS_PORT(port) 1 /* VBSC code compatability */ @@ -404,7 +404,7 @@ typedef struct ds_log_entry { #define DS_LOG_POOL_END (ds_log_entry_pool + DS_LOG_NPOOL) #define DS_IS_POOL_ENTRY(ep) (((ep) >= ds_log_entry_pool) && \ - ((ep) <= &(ds_log_entry_pool[DS_LOG_NPOOL]))) + ((ep) < &(ds_log_entry_pool[DS_LOG_NPOOL]))) /* VBSC code compatability related defines */ @@ -554,8 +554,8 @@ void ds_dump_msg(void *buf, size_t len); #define DS_DUMP_MSG(flags, buf, len) #define DS_DUMP_LDC_MSG(buf, len) -#define DS_BADHDL1 NULL -#define DS_BADHDL2 NULL +#define DS_BADHDL1 (ds_svc_hdl_t)0 +#define DS_BADHDL2 (ds_svc_hdl_t)0 #endif /* DEBUG */ |