Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic declare printflike functions and fix another prin...



details:   https://anonhg.NetBSD.org/src/rev/7faa1de39518
branches:  trunk
changeset: 845154:7faa1de39518
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Sep 20 14:20:45 2019 +0000

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

diffstat:

 sys/dev/ic/isp_netbsd.c |  32 ++++++++++++++++----------------
 sys/dev/ic/isp_netbsd.h |   7 ++++---
 2 files changed, 20 insertions(+), 19 deletions(-)

diffs (134 lines):

diff -r df23716db3a8 -r 7faa1de39518 sys/dev/ic/isp_netbsd.c
--- a/sys/dev/ic/isp_netbsd.c   Fri Sep 20 14:12:57 2019 +0000
+++ b/sys/dev/ic/isp_netbsd.c   Fri Sep 20 14:20:45 2019 +0000
@@ -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 @@
     "(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 @@
                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 @@
                }
                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 @@
 
                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 @@
                }
                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 @@
        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 @@
                        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 @@
                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;
diff -r df23716db3a8 -r 7faa1de39518 sys/dev/ic/isp_netbsd.h
--- a/sys/dev/ic/isp_netbsd.h   Fri Sep 20 14:12:57 2019 +0000
+++ b/sys/dev/ic/isp_netbsd.h   Fri Sep 20 14:20:45 2019 +0000
@@ -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 @@
 /*
  * 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 *);



Home | Main Index | Thread Index | Old Index