--- old/usr/src/cmd/dlmgmtd/dlmgmt_db.c	Thu Aug 18 14:50:48 2016
+++ new/usr/src/cmd/dlmgmtd/dlmgmt_db.c	Thu Aug 18 14:50:48 2016
@@ -723,11 +723,11 @@
 	len = strlen(buf);
 	attr_name[0] = '\0';
 	for (i = 0; i < len; i++) {
-		rename = B_FALSE;
 		char		c = buf[i];
 		boolean_t	match = (c == '=' ||
 		    (c == ',' && !found_type) || c == ';');
 
+		rename = B_FALSE;
 		/*
 		 * Move to the next character if there is no match and
 		 * if we have not reached the last character.
--- old/usr/src/cmd/ptools/Makefile.bld	Thu Aug 18 14:50:48 2016
+++ new/usr/src/cmd/ptools/Makefile.bld	Thu Aug 18 14:50:48 2016
@@ -115,6 +115,12 @@
 OBJS +=		$(OBJS_$(PROG))
 SRCS +=		$(SRCS_$(PROG))
 
+# For lint, always include ptools_common.c, but suppress the "defined but
+# not used" error, in case a given ptool doesn't need it.
+SRCS +=		../../common/ptools_common.c
+LINTFLAGS +=	-xerroff=E_NAME_DEF_NOT_USED2
+LINTFLAGS64 +=	-xerroff=E_NAME_DEF_NOT_USED2
+
 INSTALL_NEW=
 INSTALL_LEGACY=$(RM) $(ROOTPROCBINSYMLINK) ; \
 	$(LN) -s ../../bin/$(PROG) $(ROOTPROCBINSYMLINK)
--- old/usr/src/cmd/zlogin/zlogin.c	Thu Aug 18 14:50:48 2016
+++ new/usr/src/cmd/zlogin/zlogin.c	Thu Aug 18 14:50:48 2016
@@ -285,7 +285,7 @@
 	    sizeof (servaddr)) == -1) {
 		if (verbose)
 			zperror(gettext("Could not connect to zone"));
-		close(sockfd);
+		(void) close(sockfd);
 		return (-1);
 	}
 	return (sockfd);
@@ -561,8 +561,8 @@
 	if (ioctl(0, TIOCGWINSZ, &ws) == 0) {
 		if (ctlfd != -1) {
 			char buf[BUFSIZ];
-			snprintf(buf, sizeof (buf), "TIOCSWINSZ %hu %hu\n",
-			    ws.ws_row, ws.ws_col);
+			(void) snprintf(buf, sizeof (buf),
+			    "TIOCSWINSZ %hu %hu\n", ws.ws_row, ws.ws_col);
 			(void) send_ctl_sock(buf, strlen(buf));
 		} else {
 			(void) ioctl(masterfd, TIOCSWINSZ, &ws);
@@ -580,7 +580,7 @@
 	connect_flags ^= ZLOGIN_ZFD_EOF;
 	if (ctlfd != -1) {
 		char buf[BUFSIZ];
-		snprintf(buf, sizeof (buf), "SETFLAGS %u\n",
+		(void) snprintf(buf, sizeof (buf), "SETFLAGS %u\n",
 		    connect_flags);
 		(void) send_ctl_sock(buf, strlen(buf));
 	}
@@ -2217,7 +2217,7 @@
 			    (imode ? "server_ctl" : "console_sock"), B_FALSE);
 			if (masterfd != -1)
 				break;
-			sleep(1);
+			(void) sleep(1);
 		}
 
 		if (retry == MAX_RETRY) {
--- old/usr/src/cmd/zoneadmd/mcap.c	Thu Aug 18 14:50:49 2016
+++ new/usr/src/cmd/zoneadmd/mcap.c	Thu Aug 18 14:50:49 2016
@@ -162,8 +162,6 @@
 static boolean_t skip_pageout = B_FALSE;
 static boolean_t skip_pf_throttle = B_FALSE;
 
-static zlog_t	*logp;
-
 static int64_t check_suspend();
 static void get_mcap_tunables();
 
@@ -388,7 +386,6 @@
 	int			psfd;
 	prmap_t			*pmap;
 	proc_map_t		cur;
-	int			res;
 	int64_t			sum_d_rss, d_rss;
 	int64_t			old_rss;
 	int			map_cnt;
@@ -440,9 +437,10 @@
 	sum_d_rss = 0;
 	while (excess > 0 && pmap != NULL && !shutting_down) {
 		/* invalidate the entire mapping */
-		if ((res = pageout_mapping(pid, pmap)) < 0)
+		if (pageout_mapping(pid, pmap) < 0)
 			debug("pid %ld: mapping 0x%p %ldkb unpageable (%d)\n",
-			    pid, pmap->pr_vaddr, pmap->pr_size / 1024, errno);
+			    pid, (void *)pmap->pr_vaddr,
+			    (long)pmap->pr_size / 1024L, errno);
 
 		map_cnt++;
 
@@ -1156,7 +1154,6 @@
 
 	shutting_down = 0;
 	zid = id;
-	logp = zlogp;
 
 	/* all but the lx brand currently use /proc */
 	if (strcmp(brand_name, "lx") == 0) {
--- old/usr/src/cmd/zoneadmd/zfd.c	Thu Aug 18 14:50:49 2016
+++ new/usr/src/cmd/zoneadmd/zfd.c	Thu Aug 18 14:50:49 2016
@@ -1208,7 +1208,7 @@
 	 * This thread should receive SIGHUP so that it can close the log
 	 * file, and reopen it, during log rotation.
 	 */
-	sigset(SIGHUP, hup_handler);
+	(void) sigset(SIGHUP, hup_handler);
 	(void) sigfillset(&blockset);
 	(void) sigdelset(&blockset, SIGHUP);
 	(void) thr_sigsetmask(SIG_BLOCK, &blockset, NULL);
@@ -1384,6 +1384,7 @@
 	zonecfg_fini_handle(handle);
 }
 
+/* ARGSUSED -- "id" might be used in the future. */
 void
 create_log_thread(zlog_t *logp, zoneid_t id)
 {
--- old/usr/src/cmd/zoneadmd/zoneadmd.c	Thu Aug 18 14:50:49 2016
+++ new/usr/src/cmd/zoneadmd/zoneadmd.c	Thu Aug 18 14:50:49 2016
@@ -848,9 +848,11 @@
  * zone's init. When true, the contract will include CT_PR_EV_EXIT in the fatal
  * set, so that when any service which is in the same contract exits, the init
  * application will be terminated.
+ *
+ * We use the global "snap_hndl", so no parameters get passed here.
  */
 static boolean_t
-is_app_svc_dep(brand_handle_t bh)
+is_app_svc_dep(void)
 {
 	struct zone_attrtab a;
 
@@ -940,7 +942,7 @@
 	 * See if we need to setup contract dependencies between the zone's
 	 * primary application and any of its services.
 	 */
-	app_svc_dep = is_app_svc_dep(bh);
+	app_svc_dep = is_app_svc_dep();
 
 	brand_close(bh);
 
@@ -966,9 +968,11 @@
 		goto bad;
 	}
 
-	if ((st.st_mode & S_IFMT) == S_IFLNK) {
-		/* symlink, we'll have to wait and resolve when we boot */
-	} else if ((st.st_mode & S_IXUSR) == 0) {
+	/*
+	 * If a symlink, we'll have to wait and resolve when we boot,
+	 * otherwise check the executable bits now.
+	 */
+	if ((st.st_mode & S_IFMT) != S_IFLNK && (st.st_mode & S_IXUSR) == 0) {
 		zerror(zlogp, B_FALSE, "%s is not executable", initpath);
 		goto bad;
 	}
@@ -1296,7 +1300,6 @@
 
 	zone_state_t zstate;
 	zone_cmd_t cmd;
-	boolean_t debug;
 	int init_status;
 	zone_cmd_arg_t *zargp;
 
@@ -1350,7 +1353,6 @@
 		goto out;
 	}
 	cmd = zargp->cmd;
-	debug = zargp->debug;
 	init_status = zargp->status;
 
 	if (door_ucred(&uc) != 0) {
--- old/usr/src/cmd/zonecfg/zonecfg.c	Thu Aug 18 14:50:49 2016
+++ new/usr/src/cmd/zonecfg/zonecfg.c	Thu Aug 18 14:50:49 2016
@@ -5435,7 +5435,6 @@
 	uint64_t swap_limit;
 	uint64_t locked_limit;
 	uint64_t phys_limit;
-	struct stat statbuf;
 
 	assert(cmd != NULL);
 
--- old/usr/src/common/list/list.c	Thu Aug 18 14:50:49 2016
+++ new/usr/src/common/list/list.c	Thu Aug 18 14:50:49 2016
@@ -38,7 +38,17 @@
 #endif
 
 #ifdef lint
-extern list_node_t *list_d2l(list_t *list, void *obj);
+static list_node_t *
+list_d2l(list_t *list, void *obj)
+{
+	/* Pretty version for lint... */
+	uint64_t *offset = (uint64_t *)obj;
+
+	if (!IS_P2ALIGNED(obj, 8))
+		return (NULL);
+
+	return ((list_node_t *)(offset + (list->list_offset >> 3)));
+}
 #else
 #define	list_d2l(a, obj) ((list_node_t *)(((char *)obj) + (a)->list_offset))
 #endif
--- old/usr/src/lib/brand/lx/librtld_db/common/lx_librtld_db.c	Thu Aug 18 14:50:49 2016
+++ new/usr/src/lib/brand/lx/librtld_db/common/lx_librtld_db.c	Thu Aug 18 14:50:49 2016
@@ -629,6 +629,7 @@
 	for (offs = symtab; offs < strtab; offs += sizeof (Elf32_Sym)) {
 		uint32_t p;
 
+		/* LINTED - "offs" increments always in sizeof (Elf32_Sym). */
 		sym = (Elf32_Sym *)&mem[offs];
 
 		if (sym->st_name > memsz) {
--- old/usr/src/lib/brand/lx/lx_init/Makefile	Thu Aug 18 14:50:49 2016
+++ new/usr/src/lib/brand/lx/lx_init/Makefile	Thu Aug 18 14:50:49 2016
@@ -44,8 +44,9 @@
 UTSBASE =	$(SRC)/uts
 
 CFLAGS +=	$(CCVERBOSE)
-CPPFLAGS +=	-D_REENTRANT -I$(UTSBASE)/common/brand/lx
+CPPFLAGS +=	-D_FILE_OFFSET_BITS=64 -D_REENTRANT -I$(UTSBASE)/common/brand/lx
 LDLIBS +=	-lzonecfg -lipadm -lsocket -linetutil -lnsl -lcmdutils -ldhcpagent
+LINTFLAGS +=	-xerroff=E_NAME_DEF_NOT_USED2
 
 .KEEP_STATE:
 
@@ -54,7 +55,7 @@
 clean:
 	$(RM) $(PROG) $(OBJS)
 
-lint: lint_PROG lint_SRCS
+lint: lint_SRCS
 
 $(PROG): $(OBJS)
 	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
--- old/usr/src/lib/brand/lx/lx_init/lxinit.c	Thu Aug 18 14:50:50 2016
+++ new/usr/src/lib/brand/lx/lx_init/lxinit.c	Thu Aug 18 14:50:50 2016
@@ -103,7 +103,7 @@
 	 * Since a non-zero exit will cause the zone to reboot, a pause here
 	 * will prevent a mis-configured zone from spinning in a reboot loop.
 	 */
-	pause();
+	(void) pause();
 	exit(1);
 	/*NOTREACHED*/
 }
@@ -204,19 +204,21 @@
 }
 #endif /* XXX KEBE SAYS NOT YET */
 
-void
+static void
 lxi_svc_start(char *name, char *path, char *fmri)
 {
 	pid_t pid;
 	int status;
-	char *const argv[] = {
-		name,
+	char *argv[] = {
+		NULL,
 		NULL
 	};
-	char *const envp[] = {
-		fmri,
+	char *envp[] = {
+		NULL,
 		NULL
 	};
+	argv[0] = name;
+	envp[0] = fmri;
 
 	pid = fork();
 	if (pid == -1) {
@@ -235,7 +237,7 @@
 		(void) snprintf(cmd, sizeof (cmd), "%s%s", zroot != NULL ?
 		    zroot : "", path);
 
-		execve(cmd, argv, envp);
+		(void) execve(cmd, argv, envp);
 
 		lxi_err("execve(%s) failed: %s", cmd, strerror(errno));
 		/* NOTREACHED */
@@ -242,9 +244,8 @@
 	}
 
 	/* parent */
-	while (wait(&status) != pid) {
-		/* EMPTY */;
-	}
+	while (wait(&status) != pid)
+		;
 
 	if (WIFEXITED(status)) {
 		if (WEXITSTATUS(status) != 0) {
@@ -498,10 +499,10 @@
     const char *gwaddr)
 {
 	int idx, len, sockfd;
-	char rtbuf[RTMBUFSZ];
+	/* For lint-happy alignment, use a uint32_t array... */
+	uint32_t rtbuf[RTMBUFSZ / sizeof (uint32_t)];
 	struct rt_msghdr *rtm = (struct rt_msghdr *)rtbuf;
-	struct sockaddr_in *dst_sin = (struct sockaddr_in *)
-	    (rtbuf + sizeof (struct rt_msghdr));
+	struct sockaddr_in *dst_sin = (struct sockaddr_in *)(rtm + 1);
 	struct sockaddr_in *gw_sin = (struct sockaddr_in *)(dst_sin + 1);
 	struct sockaddr_in *netmask_sin = (struct sockaddr_in *)(gw_sin + 1);
 
@@ -553,15 +554,15 @@
 
 	if ((len = write(sockfd, rtbuf, rtm->rtm_msglen)) < 0) {
 		lxi_warn("could not write rtmsg: %s", strerror(errno));
-		close(sockfd);
+		(void) close(sockfd);
 		return (-1);
 	} else if (len < rtm->rtm_msglen) {
 		lxi_warn("write() rtmsg incomplete");
-		close(sockfd);
+		(void) close(sockfd);
 		return (-1);
 	}
 
-	close(sockfd);
+	(void) close(sockfd);
 	return (0);
 }
 
@@ -848,7 +849,7 @@
 	 * treats anything else as 'other' but this is enough to make it
 	 * behave better inside a zone. See 'detect_container' in systemd.
 	 */
-	execve(cmd, argv, envp);
+	(void) execve(cmd, argv, envp);
 	e = errno;
 
 	/*
--- old/usr/src/lib/brand/lx/lx_init/pipe_stream.c	Thu Aug 18 14:50:50 2016
+++ new/usr/src/lib/brand/lx/lx_init/pipe_stream.c	Thu Aug 18 14:50:50 2016
@@ -21,7 +21,6 @@
 #include <poll.h>
 #include <errno.h>
 #include <sys/types.h>
-#include <sys/debug.h>
 #include <sys/list.h>
 
 #include "pipe_stream.h"
@@ -65,7 +64,7 @@
 	VERIFY0(close(psl->psl_port));
 
 	while (!list_is_empty(&psl->psl_pipes)) {
-		pipe_stream_fini(list_head(&psl->psl_pipes));
+		(void)pipe_stream_fini(list_head(&psl->psl_pipes));
 	}
 
 	list_destroy(&psl->psl_pipes);
--- old/usr/src/lib/brand/lx/lx_init/pipe_stream.h	Thu Aug 18 14:50:50 2016
+++ new/usr/src/lib/brand/lx/lx_init/pipe_stream.h	Thu Aug 18 14:50:50 2016
@@ -41,6 +41,13 @@
 extern boolean_t pipe_stream_loop_should_run(pipe_stream_loop_t *);
 extern int pipe_stream_loop_run(pipe_stream_loop_t *);
 
+#include <assert.h>
+/*
+ * Kernel-like macros that don't trigger lint.
+ */
+#define	VERIFY0(stmt) assert((stmt) == 0)
+#define	VERIFY(stmt) assert(stmt)
+
 #ifdef __cplusplus
 }
 #endif
--- old/usr/src/lib/brand/lx/lx_init/run_command.c	Thu Aug 18 14:50:50 2016
+++ new/usr/src/lib/brand/lx/lx_init/run_command.c	Thu Aug 18 14:50:50 2016
@@ -20,7 +20,6 @@
 #include <unistd.h>
 #include <wait.h>
 #include <sys/types.h>
-#include <sys/debug.h>
 #include <libcmdutils.h>
 
 #include "run_command.h"
@@ -118,7 +117,7 @@
 		    STDERR_FILENO));
 		closefrom(3);
 
-		execve(path, argv, envp);
+		(void) execve(path, argv, envp);
 		err(127, "exec(%s) failed", path);
 	}
 
--- old/usr/src/uts/common/brand/lx/autofs/lx_autofs.c	Thu Aug 18 14:50:50 2016
+++ new/usr/src/uts/common/brand/lx/autofs/lx_autofs.c	Thu Aug 18 14:50:50 2016
@@ -88,6 +88,7 @@
 	uint32_t lad_ioctlfd;
 	uint32_t lad_arg1;
 	uint32_t lad_arg2;
+	/* LINTED - C99 construct. */
 	char	lad_path[0];
 } lx_autofs_dv_ioctl_t;
 
@@ -1518,7 +1519,7 @@
 	}
 	mutex_exit(&pidlock);
 
-	switch (cmd) {
+	switch ((unsigned int)cmd) {
 	case LX_AUTOFS_IOC_READY:
 		if ((err = lx_autofs_ack(id, vp->v_vfsp, LXACR_READY)) != 0)
 			return (err);
@@ -1570,7 +1571,8 @@
 		return (ENOTSUP);
 
 	case LX_AUTOFS_IOC_EXPIRE_MULTI:
-		lx_autofs_expire(vp->v_vfsp, cr);
+		/* Should we return lx_autofs_expire()'s value instead? */
+		(void) lx_autofs_expire(vp->v_vfsp, cr);
 		return (EAGAIN);
 
 	default:
@@ -2851,7 +2853,7 @@
 	if (fnd_vfs->vfs_op == lx_autofs_vfsops) {
 		dc->lad_arg2 = LX_AUTOFS_SB_MAGIC;
 	} else {
-		dc->lad_arg2 = ~LX_AUTOFS_SB_MAGIC;
+		dc->lad_arg2 = ~((uint32_t)LX_AUTOFS_SB_MAGIC);
 	}
 
 	VFS_RELE(fnd_vfs);
@@ -2901,7 +2903,12 @@
 lx_autofs_dev_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp,
     int *rvalp)
 {
-	switch (cmd) {
+	/*
+	 * Many of these constants are negative for a signed int.
+	 * Cast "cmd" to unsigned to prevent lint errors and not have any
+	 * other problems.
+	 */
+	switch ((unsigned int)cmd) {
 	case LX_AUTOFS_DEV_IOC_VERSION_CMD:
 		return (lx_autofs_dev_vers(arg));
 
--- old/usr/src/uts/common/brand/sn1/sn1_brand.c	Thu Aug 18 14:50:50 2016
+++ new/usr/src/uts/common/brand/sn1/sn1_brand.c	Thu Aug 18 14:50:50 2016
@@ -213,6 +213,7 @@
 	brand_solaris_exec(&sn1_brand);
 }
 
+/* ARGSUSED */
 void
 sn1_initlwp(klwp_t *l, void *bd)
 {
--- old/usr/src/uts/common/brand/solaris10/s10_brand.c	Thu Aug 18 14:50:50 2016
+++ new/usr/src/uts/common/brand/solaris10/s10_brand.c	Thu Aug 18 14:50:50 2016
@@ -368,6 +368,7 @@
 	brand_solaris_exec(&s10_brand);
 }
 
+/* ARGSUSED */
 void
 s10_initlwp(klwp_t *l, void *bd)
 {
@@ -410,6 +411,7 @@
 	kmem_free(zone->zone_brand_data, sizeof (s10_zone_data_t));
 }
 
+/* ARGSUSED */
 void
 s10_init_brand_data(zone_t *zone, kmutex_t *zsl)
 {
--- old/usr/src/uts/common/fs/tmpfs/tmp_subr.c	Thu Aug 18 14:50:50 2016
+++ new/usr/src/uts/common/fs/tmpfs/tmp_subr.c	Thu Aug 18 14:50:50 2016
@@ -189,7 +189,7 @@
 	 * system's total available swap size as the initial value. Perform the
 	 * intermediate calculation in pages to avoid overflow.
 	 */
-	if (*c == '\%') {
+	if (*c == '%') {
 		u_longlong_t cap;
 
 		if (*(c + 1) != '\0')
--- old/usr/src/uts/common/inet/ip/ipclassifier.c	Thu Aug 18 14:50:50 2016
+++ new/usr/src/uts/common/inet/ip/ipclassifier.c	Thu Aug 18 14:50:50 2016
@@ -920,7 +920,6 @@
 void
 ipcl_hash_insert_wildcard(connf_t *connfp, conn_t *connp)
 {
-	conn_t **list, *prev, *next;
 	conn_t *pconnp = NULL, *nconnp;
 	boolean_t isv4mapped = IN6_IS_ADDR_V4MAPPED(&connp->conn_laddr_v6);
 
--- old/usr/src/uts/common/io/inotify.c	Thu Aug 18 14:50:51 2016
+++ new/usr/src/uts/common/io/inotify.c	Thu Aug 18 14:50:51 2016
@@ -505,7 +505,7 @@
 	event->ine_event.len = len;
 
 	if (name != NULL)
-		strcpy(event->ine_event.name, name);
+		(void) strcpy(event->ine_event.name, name);
 
 	if (tail != NULL) {
 		tail->ine_next = event;
--- old/usr/src/uts/common/io/pseudonex.c	Thu Aug 18 14:50:51 2016
+++ new/usr/src/uts/common/io/pseudonex.c	Thu Aug 18 14:50:51 2016
@@ -385,6 +385,7 @@
 	return (-1);
 }
 
+/* ARGSUSED */
 static int
 pseudonex_fm_init(dev_info_t *dip, dev_info_t *tdip, int cap,
     ddi_iblock_cookie_t *ibc)
--- old/usr/src/uts/common/io/zfd.c	Thu Aug 18 14:50:51 2016
+++ new/usr/src/uts/common/io/zfd.c	Thu Aug 18 14:50:51 2016
@@ -890,6 +890,8 @@
 			}
 
 			/* Get the primary slave minor device number */
+			ASSERT(IS_P2ALIGNED(mp->b_cont->b_rptr, 4));
+			/* LINTED - b_rptr will always be aligned. */
 			to = *(int *)mp->b_cont->b_rptr;
 			instance = ZFD_INSTANCE(to);
 
@@ -942,6 +944,8 @@
 			prim_zfds = zfds->zfd_inst_pri;
 
 			/* Get the flow control setting */
+			ASSERT(IS_P2ALIGNED(mp->b_cont->b_rptr, 4));
+			/* LINTED - b_rptr will always be aligned. */
 			val = *(int *)mp->b_cont->b_rptr;
 			if (val != 0 && val != 1) {
 				miocack(qp, mp, 0, EINVAL);
--- old/usr/src/uts/common/os/exec.c	Thu Aug 18 14:50:51 2016
+++ new/usr/src/uts/common/os/exec.c	Thu Aug 18 14:50:51 2016
@@ -1564,8 +1564,6 @@
 static int
 stk_byte_add(uarg_t *args, const uint8_t *sp, size_t len)
 {
-	int error;
-
 	if (STK_AVAIL(args) < sizeof (int))
 		return (E2BIG);
 	*--args->stk_offp = args->stk_strp - args->stk_base;
--- old/usr/src/uts/intel/lx_brand/Makefile	Thu Aug 18 14:50:51 2016
+++ new/usr/src/uts/intel/lx_brand/Makefile	Thu Aug 18 14:50:51 2016
@@ -77,6 +77,7 @@
 #
 LINTTAGS	+= -erroff=E_ASSIGN_NARROW_CONV
 LINTTAGS	+= -erroff=E_SUSPICIOUS_COMPARISON
+LINTTAGS	+= -erroff=E_TRUE_LOGICAL_EXPR
 
 #
 #	Default build targets.
