Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb PR/55068: sc.dying: Fix printf formats:



details:   https://anonhg.NetBSD.org/src/rev/e7537d3c6707
branches:  trunk
changeset: 970133:e7537d3c6707
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Mar 13 18:17:40 2020 +0000

description:
PR/55068: sc.dying: Fix printf formats:
- no %s/%p for kernel log
- 0x% -> %#
- always %j for kernel log

diffstat:

 sys/dev/usb/aubtfwl.c       |   10 ++--
 sys/dev/usb/auvitek.c       |    8 +-
 sys/dev/usb/ehci.c          |   72 +++++++++++++++---------------
 sys/dev/usb/emdtv.c         |   16 +++---
 sys/dev/usb/emdtv_dtv.c     |    6 +-
 sys/dev/usb/ezload.c        |    6 +-
 sys/dev/usb/if_athn_usb.c   |   16 +++---
 sys/dev/usb/if_atu.c        |    8 +-
 sys/dev/usb/if_aue.c        |   42 ++++++++--------
 sys/dev/usb/if_axen.c       |   26 +++++-----
 sys/dev/usb/if_cue.c        |   28 +++++-----
 sys/dev/usb/if_mue.c        |   14 ++--
 sys/dev/usb/if_otus.c       |   38 ++++++++--------
 sys/dev/usb/if_rum.c        |    8 +-
 sys/dev/usb/if_run.c        |   24 +++++-----
 sys/dev/usb/if_smsc.c       |   16 +++---
 sys/dev/usb/if_udav.c       |   16 +++---
 sys/dev/usb/if_umb.c        |   22 ++++----
 sys/dev/usb/if_upgt.c       |   30 ++++++------
 sys/dev/usb/if_ural.c       |    8 +-
 sys/dev/usb/if_ure.c        |    6 +-
 sys/dev/usb/if_url.c        |   16 +++---
 sys/dev/usb/if_urndis.c     |   48 ++++++++++----------
 sys/dev/usb/if_urtw.c       |   28 +++++-----
 sys/dev/usb/if_urtwn.c      |   22 ++++----
 sys/dev/usb/if_zyd.c        |   12 ++--
 sys/dev/usb/irmce.c         |    6 +-
 sys/dev/usb/motg.c          |   36 +++++++-------
 sys/dev/usb/ohci.c          |   84 +++++++++++++++++-----------------
 sys/dev/usb/pseye.c         |   12 ++--
 sys/dev/usb/uatp.c          |   10 ++--
 sys/dev/usb/uaudio.c        |   46 +++++++++---------
 sys/dev/usb/ubsa.c          |    6 +-
 sys/dev/usb/ubsa_common.c   |   14 ++--
 sys/dev/usb/uchcom.c        |   12 ++--
 sys/dev/usb/ucom.c          |    8 +-
 sys/dev/usb/ucycom.c        |   10 ++--
 sys/dev/usb/udsbr.c         |    6 +-
 sys/dev/usb/udsir.c         |    6 +-
 sys/dev/usb/uftdi.c         |   30 ++++++------
 sys/dev/usb/ugen.c          |    6 +-
 sys/dev/usb/ugensa.c        |    8 +-
 sys/dev/usb/uhci.c          |   38 ++++++++--------
 sys/dev/usb/uhidev.c        |   10 ++--
 sys/dev/usb/uhmodem.c       |   10 ++--
 sys/dev/usb/uhso.c          |    8 +-
 sys/dev/usb/uipaq.c         |    6 +-
 sys/dev/usb/uirda.c         |   28 +++++-----
 sys/dev/usb/ukbd.c          |   16 +++---
 sys/dev/usb/ulpt.c          |    8 +-
 sys/dev/usb/umass.c         |   56 +++++++++++-----------
 sys/dev/usb/umass_isdata.c  |   22 ++++----
 sys/dev/usb/umass_scsipi.c  |   10 ++--
 sys/dev/usb/umct.c          |    6 +-
 sys/dev/usb/umodem_common.c |    6 +-
 sys/dev/usb/uplcom.c        |    8 +-
 sys/dev/usb/usb_quirks.c    |    6 +-
 sys/dev/usb/usbdi.c         |   20 ++++----
 sys/dev/usb/usbdi_util.c    |   10 ++--
 sys/dev/usb/usbnet.c        |   40 ++++++++--------
 sys/dev/usb/uslsa.c         |    6 +-
 sys/dev/usb/usscanner.c     |    8 +-
 sys/dev/usb/ustir.c         |   12 ++--
 sys/dev/usb/uthum.c         |   10 ++--
 sys/dev/usb/utoppy.c        |   22 ++++----
 sys/dev/usb/uts.c           |   10 ++--
 sys/dev/usb/uvideo.c        |  104 ++++++++++++++++++++++----------------------
 sys/dev/usb/uvisor.c        |    6 +-
 sys/dev/usb/uvscom.c        |    8 +-
 sys/dev/usb/vhci.c          |    6 +-
 sys/dev/usb/xhci.c          |   92 +++++++++++++++++++-------------------
 71 files changed, 720 insertions(+), 718 deletions(-)

diffs (truncated from 5911 to 300 lines):

diff -r f088cd83bced -r e7537d3c6707 sys/dev/usb/aubtfwl.c
--- a/sys/dev/usb/aubtfwl.c     Fri Mar 13 16:38:45 2020 +0000
+++ b/sys/dev/usb/aubtfwl.c     Fri Mar 13 18:17:40 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: aubtfwl.c,v 1.7 2018/09/03 16:29:33 riastradh Exp $ */
+/* $NetBSD: aubtfwl.c,v 1.8 2020/03/13 18:17:40 christos Exp $ */
 
 /*
  * Copyright (c) 2011 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aubtfwl.c,v 1.7 2018/09/03 16:29:33 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aubtfwl.c,v 1.8 2020/03/13 18:17:40 christos Exp $");
 
 #include <sys/param.h>
 #include <dev/usb/usb.h>
@@ -289,11 +289,11 @@
                        return;
                }
 
-               aprint_verbose_dev(self, "state is 0x%02x\n", state);
+               aprint_verbose_dev(self, "state is %#02x\n", state);
 
                if (!(state & AR3K_STATE_IS_PATCHED)) {
                        snprintf(firmware_name, sizeof(firmware_name),
-                               "ar3k/AthrBT_0x%08x.dfu", ver.rom);
+                               "ar3k/AthrBT_%#08x.dfu", ver.rom);
                        error = aubtfwl_firmware_load(self, firmware_name);
 
                        if (error)
@@ -313,7 +313,7 @@
                }
 
                snprintf(firmware_name, sizeof(firmware_name),
-                       "ar3k/ramps_0x%08x_%d.dfu", ver.rom, clock);
+                       "ar3k/ramps_%#08x_%d.dfu", ver.rom, clock);
                aubtfwl_firmware_load(self, firmware_name);
 
                if ((state & AR3K_STATE_MODE_MASK) != AR3K_STATE_MODE_NORMAL) {
diff -r f088cd83bced -r e7537d3c6707 sys/dev/usb/auvitek.c
--- a/sys/dev/usb/auvitek.c     Fri Mar 13 16:38:45 2020 +0000
+++ b/sys/dev/usb/auvitek.c     Fri Mar 13 18:17:40 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: auvitek.c,v 1.10 2016/04/23 10:15:31 skrll Exp $ */
+/* $NetBSD: auvitek.c,v 1.11 2020/03/13 18:17:40 christos Exp $ */
 
 /*-
  * Copyright (c) 2010 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: auvitek.c,v 1.10 2016/04/23 10:15:31 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auvitek.c,v 1.11 2020/03/13 18:17:40 christos Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -189,7 +189,7 @@
                return;
        }
 
-       aprint_debug_dev(self, "isoc endpoint 0x%02x size %d\n",
+       aprint_debug_dev(self, "isoc endpoint %#02x size %d\n",
            sc->sc_ax.ax_endpt, sc->sc_ax.ax_maxpktlen);
 
        nep = 0;
@@ -219,7 +219,7 @@
                return;
        }
 
-       aprint_debug_dev(self, "bulk endpoint 0x%02x size %d\n",
+       aprint_debug_dev(self, "bulk endpoint %#02x size %d\n",
            sc->sc_ab.ab_endpt, AUVITEK_BULK_BUFLEN);
 
        auvitek_board_init(sc);
diff -r f088cd83bced -r e7537d3c6707 sys/dev/usb/ehci.c
--- a/sys/dev/usb/ehci.c        Fri Mar 13 16:38:45 2020 +0000
+++ b/sys/dev/usb/ehci.c        Fri Mar 13 18:17:40 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ehci.c,v 1.275 2020/03/05 08:35:16 skrll Exp $ */
+/*     $NetBSD: ehci.c,v 1.276 2020/03/13 18:17:40 christos Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.275 2020/03/05 08:35:16 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.276 2020/03/13 18:17:40 christos Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -750,7 +750,7 @@
                /* Block unprocessed interrupts. */
                sc->sc_eintrs &= ~eintrs;
                EOWRITE4(sc, EHCI_USBINTR, sc->sc_eintrs);
-               printf("%s: blocking intrs 0x%x\n",
+               printf("%s: blocking intrs %#x\n",
                       device_xname(sc->sc_dev), eintrs);
        }
 
@@ -795,7 +795,7 @@
                if (EOREAD4(sc, EHCI_PORTSC(i)) & EHCI_PS_CLEAR)
                        p[i/8] |= 1 << (i%8);
                if (i % 8 == 7)
-                       DPRINTF("change(%jd)=0x%02jx", i / 8, p[i/8], 0, 0);
+                       DPRINTF("change(%jd)=%#02jx", i / 8, p[i/8], 0, 0);
        }
        xfer->ux_actlen = xfer->ux_length;
        xfer->ux_status = USBD_NORMAL_COMPLETION;
@@ -1216,7 +1216,7 @@
         */
        if ((sqtd != lsqtd->nextqtd || EHCI_QTD_GET_BYTES(status)) &&
            xfer->ux_pipe->up_dev->ud_pipe0 != xfer->ux_pipe) {
-               DPRINTF("toggle update status=0x%08jx nstatus=0x%08jx",
+               DPRINTF("toggle update status=%#08jx nstatus=%#08jx",
                    status, nstatus, 0, 0);
 #if 0
                ehci_dump_sqh(epipe->sqh);
@@ -1225,12 +1225,12 @@
                epipe->nexttoggle = EHCI_QTD_GET_TOGGLE(nstatus);
        }
 
-       DPRINTF("len=%jd actlen=%jd status=0x%08jx", xfer->ux_length, actlen,
+       DPRINTF("len=%jd actlen=%jd status=%#08jx", xfer->ux_length, actlen,
            status, 0);
        xfer->ux_actlen = actlen;
        if (status & EHCI_QTD_HALTED) {
 #ifdef EHCI_DEBUG
-               DPRINTF("halted addr=%jd endpt=0x%02jx",
+               DPRINTF("halted addr=%jd endpt=%#02jx",
                    xfer->ux_pipe->up_dev->ud_addr,
                    xfer->ux_pipe->up_endpoint->ue_edesc->bEndpointAddress,
                    0, 0);
@@ -1295,7 +1295,7 @@
        int new;
        new = EHCI_STS_INTRS(EOREAD4(sc, EHCI_USBSTS));
        if (new != last) {
-               DPRINTF("intrs=0x%04jx", new, 0, 0, 0);
+               DPRINTF("intrs=%#04jx", new, 0, 0, 0);
                last = new;
        }
 #endif
@@ -1577,7 +1577,7 @@
 
        EHCIHIST_FUNC(); EHCIHIST_CALLED();
 
-       DPRINTF("epipe=%#jx status=0x%08jx", (uintptr_t)epipe,
+       DPRINTF("epipe=%#jx status=%#08jx", (uintptr_t)epipe,
            epipe->sqh->qh.qh_qtd.qtd_status, 0, 0);
 #ifdef EHCI_DEBUG
        if (ehcidebug)
@@ -1601,17 +1601,17 @@
 {
        ehci_softc_t *sc = theehci;
        int i;
-       printf("cmd=0x%08x, sts=0x%08x, ien=0x%08x\n",
+       printf("cmd=%#08x, sts=%#08x, ien=%#08x\n",
            EOREAD4(sc, EHCI_USBCMD),
            EOREAD4(sc, EHCI_USBSTS),
            EOREAD4(sc, EHCI_USBINTR));
-       printf("frindex=0x%08x ctrdsegm=0x%08x periodic=0x%08x async=0x%08x\n",
+       printf("frindex=%#08x ctrdsegm=%#08x periodic=%#08x async=%#08x\n",
            EOREAD4(sc, EHCI_FRINDEX),
            EOREAD4(sc, EHCI_CTRLDSSEGMENT),
            EOREAD4(sc, EHCI_PERIODICLISTBASE),
            EOREAD4(sc, EHCI_ASYNCLISTADDR));
        for (i = 1; i <= sc->sc_noport; i++)
-               printf("port %d status=0x%08x\n", i,
+               printf("port %d status=%#08x\n", i,
                    EOREAD4(sc, EHCI_PORTSC(i)));
 }
 
@@ -1622,21 +1622,21 @@
 
        EHCIHIST_FUNC(); EHCIHIST_CALLED();
 
-       DPRINTF("cmd     = 0x%08jx  sts      = 0x%08jx  ien      = 0x%08jx",
+       DPRINTF("cmd     = %#08jx  sts      = %#08jx  ien      = %#08jx",
            EOREAD4(sc, EHCI_USBCMD), EOREAD4(sc, EHCI_USBSTS),
            EOREAD4(sc, EHCI_USBINTR), 0);
-       DPRINTF("frindex = 0x%08jx  ctrdsegm = 0x%08jx  periodic = 0x%08jx  "
-           "async   = 0x%08jx",
+       DPRINTF("frindex = %#08jx  ctrdsegm = %#08jx  periodic = %#08jx  "
+           "async   = %#08jx",
            EOREAD4(sc, EHCI_FRINDEX), EOREAD4(sc, EHCI_CTRLDSSEGMENT),
            EOREAD4(sc, EHCI_PERIODICLISTBASE),
            EOREAD4(sc, EHCI_ASYNCLISTADDR));
        for (i = 1; i <= sc->sc_noport; i += 2) {
                if (i == sc->sc_noport) {
-                       DPRINTF("port %jd status = 0x%08jx", i,
+                       DPRINTF("port %jd status = %#08jx", i,
                            EOREAD4(sc, EHCI_PORTSC(i)), 0, 0);
                } else {
-                       DPRINTF("port %jd status = 0x%08jx  port %jd "
-                           "status = 0x%08jx",
+                       DPRINTF("port %jd status = %#08jx  port %jd "
+                           "status = %#08jx",
                            i, EOREAD4(sc, EHCI_PORTSC(i)),
                            i+1, EOREAD4(sc, EHCI_PORTSC(i+1)));
                }
@@ -1644,7 +1644,7 @@
 }
 
 #define ehci_dump_link(link, type) do {                                        \
-       DPRINTF("    link 0x%08jx (T = %jd):",                          \
+       DPRINTF("    link %#08jx (T = %jd):",                           \
            link,                                                       \
            link & EHCI_LINK_TERMINATE ? 1 : 0, 0, 0);                  \
        if (type) {                                                     \
@@ -1687,7 +1687,7 @@
        usb_syncmem(&sqtd->dma, sqtd->offs,
            sizeof(sqtd->qtd), BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
 
-       DPRINTFN(10, "QTD(%#jx) at 0x%08jx:", (uintptr_t)sqtd, sqtd->physaddr,
+       DPRINTFN(10, "QTD(%#jx) at %#08jx:", (uintptr_t)sqtd, sqtd->physaddr,
            0, 0);
        ehci_dump_qtd(&sqtd->qtd);
 
@@ -1702,7 +1702,7 @@
        uint32_t s = le32toh(qtd->qtd_status);
 
        DPRINTFN(10,
-           "     next = 0x%08jx  altnext = 0x%08jx  status = 0x%08jx",
+           "     next = %#08jx  altnext = %#08jx  status = %#08jx",
            qtd->qtd_next, qtd->qtd_altnext, s, 0);
        DPRINTFN(10,
            "   toggle = %jd ioc = %jd bytes = %#jx c_page = %#jx",
@@ -1750,7 +1750,7 @@
 
        endp = le32toh(qh->qh_endp);
        DPRINTFN(10, "    endp = %#jx", endp, 0, 0, 0);
-       DPRINTFN(10, "        addr = 0x%02jx  inact = %jd  endpt = %jd  "
+       DPRINTFN(10, "        addr = %#02jx  inact = %jd  endpt = %jd  "
            "eps = %jd",
            EHCI_QH_GET_ADDR(endp), EHCI_QH_GET_INACT(endp),
            EHCI_QH_GET_ENDPT(endp), EHCI_QH_GET_EPS(endp));
@@ -1762,9 +1762,9 @@
 
        endphub = le32toh(qh->qh_endphub);
        DPRINTFN(10, " endphub = %#jx", endphub, 0, 0, 0);
-       DPRINTFN(10, "      smask = 0x%02jx  cmask = 0x%02jx one %jx",
+       DPRINTFN(10, "      smask = %#02jx  cmask = %#02jx one %jx",
            EHCI_QH_GET_SMASK(endphub), EHCI_QH_GET_CMASK(endphub), 1, 0);
-       DPRINTFN(10, "      huba  = 0x%02jx  port  = %jd  mult = %jd",
+       DPRINTFN(10, "      huba  = %#02jx  port  = %jd  mult = %jd",
            EHCI_QH_GET_HUBA(endphub), EHCI_QH_GET_PORT(endphub),
            EHCI_QH_GET_MULT(endphub), 0);
 
@@ -1932,7 +1932,7 @@
                        pipe->up_methods = &ehci_root_intr_methods;
                        break;
                default:
-                       DPRINTF("bad bEndpointAddress 0x%02jx",
+                       DPRINTF("bad bEndpointAddress %#02jx",
                            ed->bEndpointAddress, 0, 0, 0);
                        return USBD_INVAL;
                }
@@ -2192,12 +2192,12 @@
 
        /* ask for doorbell */
        EOWRITE4(sc, EHCI_USBCMD, EOREAD4(sc, EHCI_USBCMD) | EHCI_CMD_IAAD);
-       DPRINTF("cmd = 0x%08jx sts = 0x%08jx",
+       DPRINTF("cmd = %#08jx sts = %#08jx",
            EOREAD4(sc, EHCI_USBCMD), EOREAD4(sc, EHCI_USBSTS), 0, 0);
 
        error = cv_timedwait(&sc->sc_doorbell, &sc->sc_lock, hz); /* bell wait */
 
-       DPRINTF("cmd = 0x%08jx sts = 0x%08jx ... done",
+       DPRINTF("cmd = %#08jx sts = %#08jx ... done",
            EOREAD4(sc, EHCI_USBCMD), EOREAD4(sc, EHCI_USBSTS), 0, 0);
 #ifdef DIAGNOSTIC
        if (error == EWOULDBLOCK) {
@@ -2322,7 +2322,7 @@
        if (sc->sc_dying)
                return -1;
 
-       DPRINTF("type=0x%02jx request=%02jx", req->bmRequestType, req->bRequest,
+       DPRINTF("type=%#02jx request=%02jx", req->bmRequestType, req->bRequest,
            0, 0);
 
        len = UGETW(req->wLength);
@@ -2358,7 +2358,7 @@
                }
                port = EHCI_PORTSC(index);
                v = EOREAD4(sc, port);
-               DPRINTF("portsc=0x%08jx", v, 0, 0, 0);
+               DPRINTF("portsc=%#08jx", v, 0, 0, 0);
                v &= ~EHCI_PS_CLEAR;
                switch (value) {
                case UHF_PORT_ENABLE:
@@ -2457,7 +2457,7 @@
                        return -1;
                }
                v = EOREAD4(sc, EHCI_PORTSC(index));
-               DPRINTF("port status=0x%04jx", v, 0, 0, 0);
+               DPRINTF("port status=%#04jx", v, 0, 0, 0);



Home | Main Index | Thread Index | Old Index