Module Name:    src
Committed By:   christos
Date:           Fri Sep 20 14:20:45 UTC 2019

Modified Files:
        src/sys/dev/ic: isp_netbsd.c isp_netbsd.h

Log Message:
declare printflike functions and fix another printf format.
also change 0x%x -> %#x.


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/sys/dev/ic/isp_netbsd.c
cvs rdiff -u -r1.75 -r1.76 src/sys/dev/ic/isp_netbsd.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/isp_netbsd.c
diff -u src/sys/dev/ic/isp_netbsd.c:1.92 src/sys/dev/ic/isp_netbsd.c:1.93
--- src/sys/dev/ic/isp_netbsd.c:1.92	Fri Sep 20 05:07:35 2019
+++ src/sys/dev/ic/isp_netbsd.c	Fri Sep 20 10:20:45 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: isp_netbsd.c,v 1.92 2019/09/20 09:07:35 maxv Exp $ */
+/* $NetBSD: isp_netbsd.c,v 1.93 2019/09/20 14:20:45 christos Exp $ */
 /*
  * Platform (NetBSD) dependent common attachment code for Qlogic adapters.
  */
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: isp_netbsd.c,v 1.92 2019/09/20 09:07:35 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isp_netbsd.c,v 1.93 2019/09/20 14:20:45 christos Exp $");
 
 #include <dev/ic/isp_netbsd.h>
 #include <dev/ic/isp_ioctl.h>
@@ -79,7 +79,7 @@ static const char *roles[4] = {
     "(none)", "Target", "Initiator", "Target/Initiator"
 };
 static const char prom3[] =
-    "PortID 0x%06x Departed from Target %u because of %s";
+    "PortID %#06x Departed from Target %u because of %s";
 int isp_change_is_bad = 0;	/* "changed" devices are bad */
 int isp_quickboot_time = 15;	/* don't wait more than N secs for loop up */
 static int isp_fabric_hysteresis = 5;
@@ -730,7 +730,7 @@ isprequest(struct scsipi_channel *chan, 
 		sdp->update = 1;
 		ISP_UNLOCK(isp);
 		isp_prt(isp, ISP_LOGDEBUG1,
-		    "isprequest: device flags 0x%x for %d.%d.X",
+		    "isprequest: device flags %#x for %d.%d.X",
 		    dflags, chan->chan_channel, xm->xm_target);
 		break;
 	}
@@ -809,7 +809,7 @@ isp_done(XS_T *xs)
 		}
 		if (xs->error == XS_DRIVER_STUFFUP) {
 			isp_prt(isp, ISP_LOGERR,
-			    "BOTCHED cmd for %d.%d.%d cmd 0x%x datalen %ld",
+			    "BOTCHED cmd for %d.%d.%d cmd %#x datalen %ld",
 			    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs),
 			    XS_CDBP(xs)[0], (long) XS_XFRLEN(xs));
 		}
@@ -841,13 +841,13 @@ isp_dog(void *arg)
 
 		if (XS_CMD_DONE_P(xs)) {
 			isp_prt(isp, ISP_LOGDEBUG1,
-			    "watchdog found done cmd (handle 0x%x)", handle);
+			    "watchdog found done cmd (handle %#x)", handle);
 			goto out;
 		}
 
 		if (XS_CMD_WDOG_P(xs)) {
 			isp_prt(isp, ISP_LOGDEBUG1,
-			    "recursive watchdog (handle 0x%x)", handle);
+			    "recursive watchdog (handle %#x)", handle);
 			goto out;
 		}
 
@@ -859,12 +859,12 @@ isp_dog(void *arg)
 		}
 		if (XS_CMD_DONE_P(xs)) {
 			isp_prt(isp, ISP_LOGDEBUG1,
-			    "watchdog cleanup for handle 0x%x", handle);
+			    "watchdog cleanup for handle %#x", handle);
 			XS_CMD_C_WDOG(xs);
 			isp_done(xs);
 		} else if (XS_CMD_GRACE_P(xs)) {
 			isp_prt(isp, ISP_LOGDEBUG1,
-			    "watchdog timeout for handle 0x%x", handle);
+			    "watchdog timeout for handle %#x", handle);
 			/*
 			 * Make sure the command is *really* dead before we
 			 * release the handle (and DMA resources) for reuse.
@@ -1180,11 +1180,11 @@ isp_async(struct ispsoftc *isp, ispasync
 	int bus, tgt;
 	const char *msg = NULL;
 	static const char prom[] =
-	    "PortID 0x%06x handle 0x%x role %s %s\n"
-	    "      WWNN 0x%08x%08x WWPN 0x%08x%08x";
+	    "PortID %#06x handle %#x role %s %s\n"
+	    "      WWNN %#08x%08x WWPN %#08x%08x";
 	static const char prom2[] =
-	    "PortID 0x%06x handle 0x%x role %s %s tgt %u\n"
-	    "      WWNN 0x%08x%08x WWPN 0x%08x%08x";
+	    "PortID %#06x handle %#x role %s %s tgt %u\n"
+	    "      WWNN %#08x%08x WWPN %#08x%08x";
 	fcportdb_t *lp;
 	va_list ap;
 
@@ -1495,7 +1495,7 @@ isp_async(struct ispsoftc *isp, ispasync
 			bus = 0;
 		}
                 isp_prt(isp, ISP_LOGERR,
-                    "Internal Firmware Error on bus %d @ RISC Address 0x%x",
+                    "Internal Firmware Error on bus %d @ RISC Address %#x",
                     bus, mbox1);
 		if (IS_FC(isp)) {
 			if (isp->isp_osinfo.blocked == 0) {
@@ -1650,9 +1650,9 @@ isp_mbox_wait_complete(struct ispsoftc *
 		microtime(&finish);
 		timersub(&finish, &start, &elapsed);
 		isp_prt(isp, ISP_LOGWARN,
-		    "%s Mailbox Command (0x%x) Timeout (%uus actual)",
+		    "%s Mailbox Command (%#x) Timeout (%juus actual)",
 		    isp->isp_osinfo.mbox_sleep_ok? "Interrupting" : "Polled",
-		    isp->isp_lastmbxcmd, (elapsed.tv_sec * 1000000) +
+		    isp->isp_lastmbxcmd, (intmax_t)(elapsed.tv_sec * 1000000) +
 		    elapsed.tv_usec);
 		mbp->param[0] = MBOX_TIMEOUT;
 		isp->isp_osinfo.mboxcmd_done = 1;

Index: src/sys/dev/ic/isp_netbsd.h
diff -u src/sys/dev/ic/isp_netbsd.h:1.75 src/sys/dev/ic/isp_netbsd.h:1.76
--- src/sys/dev/ic/isp_netbsd.h:1.75	Fri Aug 28 09:03:36 2015
+++ src/sys/dev/ic/isp_netbsd.h	Fri Sep 20 10:20:45 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: isp_netbsd.h,v 1.75 2015/08/28 13:03:36 joerg Exp $ */
+/* $NetBSD: isp_netbsd.h,v 1.76 2019/09/20 14:20:45 christos Exp $ */
 /*
  * NetBSD Specific definitions for the Qlogic ISP Host Adapter
  */
@@ -394,8 +394,9 @@ void isp_uninit(ispsoftc_t *);
 /*
  * Platform Library Functionw
  */
-void isp_prt(ispsoftc_t *, int level, const char *, ...);
-void isp_xs_prt(ispsoftc_t *, XS_T *, int level, const char *, ...);
+void isp_prt(ispsoftc_t *, int level, const char *, ...) __printflike(3, 4);
+void isp_xs_prt(ispsoftc_t *, XS_T *, int level, const char *, ...)
+    __printflike(4, 5);
 void isp_lock(ispsoftc_t *);
 void isp_unlock(ispsoftc_t *);
 uint64_t isp_microtime_sub(struct timeval *, struct timeval *);

Reply via email to