Use %z* for size_t

while there, fix a few %d into %u
---
 sys/arch/i386/pci/pcibios.c |    2 +-
 sys/dev/ic/bwi.c            |    4 ++--
 sys/dev/ic/pgt.c            |    6 +++---
 sys/dev/ic/ti.c             |    4 ++--
 sys/dev/pci/amdiic.c        |    4 ++--
 sys/dev/pci/amdpm.c         |    2 +-
 sys/dev/pci/if_iwi.c        |    4 ++--
 sys/dev/pci/if_iwn.c        |   10 +++++-----
 sys/dev/pci/if_lge.c        |    4 ++--
 sys/dev/pci/if_nge.c        |    4 ++--
 sys/dev/pci/if_tl.c         |    2 +-
 sys/dev/pci/if_wb.c         |    2 +-
 sys/dev/pci/if_wpi.c        |    4 ++--
 sys/dev/pci/piixpm.c        |    2 +-
 sys/dev/pci/yds.c           |    2 +-
 sys/dev/usb/if_urndis.c     |   12 ++++++------
 sys/netinet/ip_output.c     |    2 +-
 sys/netinet6/ip6_forward.c  |    2 +-
 sys/netinet6/ip6_output.c   |    2 +-
 sys/nfs/nfs_socket.c        |    4 ++--
 20 files changed, 39 insertions(+), 39 deletions(-)

diff --git sys/arch/i386/pci/pcibios.c sys/arch/i386/pci/pcibios.c
index 1b34391..372ac51 100644
--- sys/arch/i386/pci/pcibios.c
+++ sys/arch/i386/pci/pcibios.c
@@ -260,7 +260,7 @@ pcibios_pir_init(struct pcibios_softc *sc)
                        cksum += p[i];
 
                printf("%s: PCI IRQ Routing Table rev %d.%d @ 0x%lx/%d "
-                   "(%d entries)\n", sc->sc_dev.dv_xname,
+                   "(%zd entries)\n", sc->sc_dev.dv_xname,
                    pirh->version >> 8, pirh->version & 0xff, pa,
                    pirh->tablesize, (pirh->tablesize - sizeof(*pirh)) / 16);
 
diff --git sys/dev/ic/bwi.c sys/dev/ic/bwi.c
index 6295172..934a6ac 100644
--- sys/dev/ic/bwi.c
+++ sys/dev/ic/bwi.c
@@ -1673,7 +1673,7 @@ bwi_fwimage_is_valid(struct bwi_softc *sc, uint8_t *fw, 
size_t fw_len,
        const struct bwi_fwhdr *hdr;
 
        if (fw_len < sizeof(*hdr)) {
-               printf("%s: invalid firmware (%s): invalid size %u\n",
+               printf("%s: invalid firmware (%s): invalid size %zu\n",
                    sc->sc_dev.dv_xname, fw_name, fw_len);
                return (1);
        }
@@ -1686,7 +1686,7 @@ bwi_fwimage_is_valid(struct bwi_softc *sc, uint8_t *fw, 
size_t fw_len,
                 */
                if (betoh32(hdr->fw_size) != fw_len - sizeof(*hdr)) {
                        printf("%s: invalid firmware (%s): size mismatch, "
-                           "fw %u, real %u\n",
+                           "fw %u, real %zu\n",
                            sc->sc_dev.dv_xname,
                            fw_name,
                            betoh32(hdr->fw_size),
diff --git sys/dev/ic/pgt.c sys/dev/ic/pgt.c
index 692b72c..6f6a5d6 100644
--- sys/dev/ic/pgt.c
+++ sys/dev/ic/pgt.c
@@ -3193,7 +3193,7 @@ pgt_dma_alloc_queue(struct pgt_softc *sc, enum pgt_queue 
pq)
                error = bus_dmamem_alloc(sc->sc_dmat, PGT_FRAG_SIZE, PAGE_SIZE,
                    0, &pd->pd_dmas, 1, &nsegs, BUS_DMA_WAITOK);
                if (error != 0) {
-                       printf("%s: error alloc frag %u on queue %u\n",
+                       printf("%s: error alloc frag %zu on queue %u\n",
                            sc->sc_dev.dv_xname, i, pq);
                        free(pd, M_DEVBUF);
                        break;
@@ -3202,7 +3202,7 @@ pgt_dma_alloc_queue(struct pgt_softc *sc, enum pgt_queue 
pq)
                error = bus_dmamem_map(sc->sc_dmat, &pd->pd_dmas, nsegs,
                    PGT_FRAG_SIZE, (caddr_t *)&pd->pd_mem, BUS_DMA_WAITOK);
                if (error != 0) {
-                       printf("%s: error map frag %u on queue %u\n",
+                       printf("%s: error map frag %zu on queue %u\n",
                            sc->sc_dev.dv_xname, i, pq);
                        free(pd, M_DEVBUF);
                        break;
@@ -3212,7 +3212,7 @@ pgt_dma_alloc_queue(struct pgt_softc *sc, enum pgt_queue 
pq)
                        error = bus_dmamap_load(sc->sc_dmat, pd->pd_dmam,
                            pd->pd_mem, PGT_FRAG_SIZE, NULL, BUS_DMA_NOWAIT);
                        if (error != 0) {
-                               printf("%s: error load frag %u on queue %u\n",
+                               printf("%s: error load frag %zu on queue %u\n",
                                    sc->sc_dev.dv_xname, i, pq);
                                bus_dmamem_free(sc->sc_dmat, &pd->pd_dmas,
                                    nsegs);
diff --git sys/dev/ic/ti.c sys/dev/ic/ti.c
index 85e3a2a..902591f 100644
--- sys/dev/ic/ti.c
+++ sys/dev/ic/ti.c
@@ -612,7 +612,7 @@ ti_alloc_jumbo_mem(struct ti_softc *sc)
        state = 1;
        if (bus_dmamem_map(sc->sc_dmatag, &seg, rseg, TI_JMEM, &kva,
            BUS_DMA_NOWAIT)) {
-               printf("%s: can't map dma buffers (%d bytes)\n",
+               printf("%s: can't map dma buffers (%zu bytes)\n",
                    sc->sc_dv.dv_xname, TI_JMEM);
                error = ENOBUFS;
                goto out;
@@ -1600,7 +1600,7 @@ ti_attach(struct ti_softc *sc)
        }
        if (bus_dmamem_map(sc->sc_dmatag, &seg, rseg,
            sizeof(struct ti_ring_data), &kva, BUS_DMA_NOWAIT)) {
-               printf("%s: can't map dma buffers (%d bytes)\n",
+               printf("%s: can't map dma buffers (%zu bytes)\n",
                       sc->sc_dv.dv_xname, sizeof(struct ti_ring_data));
                goto fail_1;
        }
diff --git sys/dev/pci/amdiic.c sys/dev/pci/amdiic.c
index f8203e8..127d2f4 100644
--- sys/dev/pci/amdiic.c
+++ sys/dev/pci/amdiic.c
@@ -340,8 +340,8 @@ amdiic_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr,
                        DELAY(AMDIIC_DELAY);
                }
                if (st == 0) {
-                       printf("%s: exec: op %d, addr 0x%02x, cmdlen %d, "
-                           "len %d, flags 0x%02x: timeout\n",
+                       printf("%s: exec: op %d, addr 0x%02x, cmdlen %zu, "
+                           "len %zu, flags 0x%02x: timeout\n",
                            sc->sc_dev.dv_xname, op, addr, cmdlen, len, flags);
                        return (1);
                }
diff --git sys/dev/pci/amdpm.c sys/dev/pci/amdpm.c
index 5410701..b41ecf4 100644
--- sys/dev/pci/amdpm.c
+++ sys/dev/pci/amdpm.c
@@ -504,7 +504,7 @@ timeout:
        /*
         * Transfer timeout. Kill the transaction and clear status bits.
         */
-       printf("%s: exec: op %d, addr 0x%02x, cmdlen %d, len %d, "
+       printf("%s: exec: op %d, addr 0x%02x, cmdlen %zu, len %zu, "
            "flags 0x%02x: timeout, status 0x%b\n",
            sc->sc_dev.dv_xname, op, addr, cmdlen, len, flags,
            st, AMDPM_SMBSTAT_BITS);
diff --git sys/dev/pci/if_iwi.c sys/dev/pci/if_iwi.c
index 8530ec4..8dd5cf1 100644
--- sys/dev/pci/if_iwi.c
+++ sys/dev/pci/if_iwi.c
@@ -2239,7 +2239,7 @@ iwi_init(struct ifnet *ifp)
                goto fail1;
        }
        if (size < sizeof (struct iwi_firmware_hdr)) {
-               printf("%s: firmware image too short: %u bytes\n",
+               printf("%s: firmware image too short: %zu bytes\n",
                    sc->sc_dev.dv_xname, size);
                error = EINVAL;
                goto fail2;
@@ -2256,7 +2256,7 @@ iwi_init(struct ifnet *ifp)
 
        if (size < sizeof (struct iwi_firmware_hdr) + letoh32(hdr->bootsz) +
            letoh32(hdr->ucodesz) + letoh32(hdr->mainsz)) {
-               printf("%s: firmware image too short: %u bytes\n",
+               printf("%s: firmware image too short: %zu bytes\n",
                    sc->sc_dev.dv_xname, size);
                error = EINVAL;
                goto fail2;
diff --git sys/dev/pci/if_iwn.c sys/dev/pci/if_iwn.c
index 1b4eee7..c16ec6c 100644
--- sys/dev/pci/if_iwn.c
+++ sys/dev/pci/if_iwn.c
@@ -5292,7 +5292,7 @@ iwn_read_firmware_leg(struct iwn_softc *sc, struct 
iwn_fw_info *fw)
                ptr++;
        }
        if (fw->size < hdrlen) {
-               printf("%s: firmware too short: %d bytes\n",
+               printf("%s: firmware too short: %zu bytes\n",
                    sc->sc_dev.dv_xname, fw->size);
                return EINVAL;
        }
@@ -5305,7 +5305,7 @@ iwn_read_firmware_leg(struct iwn_softc *sc, struct 
iwn_fw_info *fw)
        /* Check that all firmware sections fit. */
        if (fw->size < hdrlen + fw->main.textsz + fw->main.datasz +
            fw->init.textsz + fw->init.datasz + fw->boot.textsz) {
-               printf("%s: firmware too short: %d bytes\n",
+               printf("%s: firmware too short: %zu bytes\n",
                    sc->sc_dev.dv_xname, fw->size);
                return EINVAL;
        }
@@ -5333,7 +5333,7 @@ iwn_read_firmware_tlv(struct iwn_softc *sc, struct 
iwn_fw_info *fw,
        uint32_t len;
 
        if (fw->size < sizeof (*hdr)) {
-               printf("%s: firmware too short: %d bytes\n",
+               printf("%s: firmware too short: %zu bytes\n",
                    sc->sc_dev.dv_xname, fw->size);
                return EINVAL;
        }
@@ -5365,7 +5365,7 @@ iwn_read_firmware_tlv(struct iwn_softc *sc, struct 
iwn_fw_info *fw,
 
                ptr += sizeof (*tlv);
                if (ptr + len > end) {
-                       printf("%s: firmware too short: %d bytes\n",
+                       printf("%s: firmware too short: %zu bytes\n",
                            sc->sc_dev.dv_xname, fw->size);
                        return EINVAL;
                }
@@ -5420,7 +5420,7 @@ iwn_read_firmware(struct iwn_softc *sc)
                return error;
        }
        if (fw->size < sizeof (uint32_t)) {
-               printf("%s: firmware too short: %d bytes\n",
+               printf("%s: firmware too short: %zu bytes\n",
                    sc->sc_dev.dv_xname, fw->size);
                free(fw->data, M_DEVBUF);
                return EINVAL;
diff --git sys/dev/pci/if_lge.c sys/dev/pci/if_lge.c
index 82d9290..c1c7049 100644
--- sys/dev/pci/if_lge.c
+++ sys/dev/pci/if_lge.c
@@ -483,7 +483,7 @@ lge_attach(struct device *parent, struct device *self, void 
*aux)
        if (bus_dmamem_map(sc->sc_dmatag, &seg, rseg,
                           sizeof(struct lge_list_data), &kva,
                           BUS_DMA_NOWAIT)) {
-               printf("%s: can't map dma buffers (%d bytes)\n",
+               printf("%s: can't map dma buffers (%zd bytes)\n",
                       sc->sc_dv.dv_xname, sizeof(struct lge_list_data));
                goto fail_3;
        }
@@ -726,7 +726,7 @@ lge_alloc_jumbo_mem(struct lge_softc *sc)
        state = 1;
        if (bus_dmamem_map(sc->sc_dmatag, &seg, rseg, LGE_JMEM, &kva,
                           BUS_DMA_NOWAIT)) {
-               printf("%s: can't map dma buffers (%d bytes)\n",
+               printf("%s: can't map dma buffers (%zd bytes)\n",
                       sc->sc_dv.dv_xname, LGE_JMEM);
                error = ENOBUFS;
                goto out;
diff --git sys/dev/pci/if_nge.c sys/dev/pci/if_nge.c
index e04bebb..91551c7 100644
--- sys/dev/pci/if_nge.c
+++ sys/dev/pci/if_nge.c
@@ -813,7 +813,7 @@ nge_attach(parent, self, aux)
        if (bus_dmamem_map(sc->sc_dmatag, &seg, rseg,
                           sizeof(struct nge_list_data), &kva,
                           BUS_DMA_NOWAIT)) {
-               printf("%s: can't map dma buffers (%d bytes)\n",
+               printf("%s: can't map dma buffers (%zd bytes)\n",
                       sc->sc_dv.dv_xname, sizeof(struct nge_list_data));
                goto fail_3;
        }
@@ -1085,7 +1085,7 @@ nge_alloc_jumbo_mem(sc)
        state = 1;
        if (bus_dmamem_map(sc->sc_dmatag, &seg, rseg, NGE_JMEM, &kva,
                           BUS_DMA_NOWAIT)) {
-               printf("%s: can't map dma buffers (%d bytes)\n",
+               printf("%s: can't map dma buffers (%zd bytes)\n",
                       sc->sc_dv.dv_xname, NGE_JMEM);
                error = ENOBUFS;
                goto out;
diff --git sys/dev/pci/if_tl.c sys/dev/pci/if_tl.c
index 9cc1143..2af569e 100644
--- sys/dev/pci/if_tl.c
+++ sys/dev/pci/if_tl.c
@@ -2052,7 +2052,7 @@ tl_attach(parent, self, aux)
        }
        if (bus_dmamem_map(sc->sc_dmat, &seg, rseg, sizeof(struct tl_list_data),
            &kva, BUS_DMA_NOWAIT)) {
-               printf("%s: can't map dma buffers (%d bytes)\n",
+               printf("%s: can't map dma buffers (%zd bytes)\n",
                    sc->sc_dev.dv_xname, sizeof(struct tl_list_data));
                bus_dmamem_free(sc->sc_dmat, &seg, rseg);
                return;
diff --git sys/dev/pci/if_wb.c sys/dev/pci/if_wb.c
index 4039f0d..cdb799a 100644
--- sys/dev/pci/if_wb.c
+++ sys/dev/pci/if_wb.c
@@ -773,7 +773,7 @@ wb_attach(parent, self, aux)
        }
        if (bus_dmamem_map(pa->pa_dmat, &seg, rseg,
            sizeof(struct wb_list_data), &kva, BUS_DMA_NOWAIT)) {
-               printf(": can't map list data, size %d\n",
+               printf(": can't map list data, size %zd\n",
                    sizeof(struct wb_list_data));
                goto fail_3;
        }
diff --git sys/dev/pci/if_wpi.c sys/dev/pci/if_wpi.c
index 693bfb9..8b5d884 100644
--- sys/dev/pci/if_wpi.c
+++ sys/dev/pci/if_wpi.c
@@ -2988,7 +2988,7 @@ wpi_read_firmware(struct wpi_softc *sc)
                return error;
        }
        if (size < sizeof (*hdr)) {
-               printf("%s: truncated firmware header: %d bytes\n",
+               printf("%s: truncated firmware header: %zu bytes\n",
                    sc->sc_dev.dv_xname, size);
                free(fw->data, M_DEVBUF);
                return EINVAL;
@@ -3017,7 +3017,7 @@ wpi_read_firmware(struct wpi_softc *sc)
        /* Check that all firmware sections fit. */
        if (size < sizeof (*hdr) + fw->main.textsz + fw->main.datasz +
            fw->init.textsz + fw->init.datasz + fw->boot.textsz) {
-               printf("%s: firmware file too short: %d bytes\n",
+               printf("%s: firmware file too short: %zu bytes\n",
                    sc->sc_dev.dv_xname, size);
                free(fw->data, M_DEVBUF);
                return EINVAL;
diff --git sys/dev/pci/piixpm.c sys/dev/pci/piixpm.c
index 782c1ac..7f18292 100644
--- sys/dev/pci/piixpm.c
+++ sys/dev/pci/piixpm.c
@@ -359,7 +359,7 @@ timeout:
        /*
         * Transfer timeout. Kill the transaction and clear status bits.
         */
-       printf("%s: exec: op %d, addr 0x%02x, cmdlen %d, len %d, "
+       printf("%s: exec: op %d, addr 0x%02x, cmdlen %zu, len %zu, "
            "flags 0x%02x: timeout, status 0x%b\n",
            sc->sc_dev.dv_xname, op, addr, cmdlen, len, flags,
            st, PIIX_SMB_HS_BITS);
diff --git sys/dev/pci/yds.c sys/dev/pci/yds.c
index 7b75622..8bef44b 100644
--- sys/dev/pci/yds.c
+++ sys/dev/pci/yds.c
@@ -1345,7 +1345,7 @@ yds_trigger_output(void *addr, void *start, void *end, 
int blksize,
                u_int32_t ctrlsize;
                if ((ctrlsize = YREAD4(sc, YDS_PLAY_CTRLSIZE)) !=
                    sizeof(struct play_slot_ctrl_bank) / sizeof(u_int32_t))
-                       panic("%s: invalid play slot ctrldata %d %d",
+                       panic("%s: invalid play slot ctrldata %d %zd",
                              sc->sc_dev.dv_xname, ctrlsize,
                              sizeof(struct play_slot_ctrl_bank));
        }
diff --git sys/dev/usb/if_urndis.c sys/dev/usb/if_urndis.c
index fff2029..a394428 100644
--- sys/dev/usb/if_urndis.c
+++ sys/dev/usb/if_urndis.c
@@ -342,8 +342,8 @@ urndis_ctrl_handle_query(struct urndis_softc *sc,
        if (letoh32(msg->rm_infobuflen) + letoh32(msg->rm_infobufoffset) +
            RNDIS_HEADER_OFFSET > letoh32(msg->rm_len)) {
                printf("%s: ctrl message error: invalid query info "
-                   "len/offset/end_position(%d/%d/%d) -> "
-                   "go out of buffer limit %d\n",
+                   "len/offset/end_position(%u/%u/%zu) -> "
+                   "go out of buffer limit %u\n",
                    DEVNAME(sc),
                    letoh32(msg->rm_infobuflen),
                    letoh32(msg->rm_infobufoffset), 
@@ -806,7 +806,7 @@ urndis_decap(struct urndis_softc *sc, struct urndis_chain 
*c, u_int32_t len)
 
                if (len < sizeof(*msg)) {
                        printf("%s: urndis_decap invalid buffer len %u < "
-                           "minimum header %u\n",
+                           "minimum header %zu\n",
                            DEVNAME(sc),
                            len,
                            sizeof(*msg));
@@ -833,7 +833,7 @@ urndis_decap(struct urndis_softc *sc, struct urndis_chain 
*c, u_int32_t len)
                        return;
                }
                if (letoh32(msg->rm_len) < sizeof(*msg)) {
-                       printf("%s: urndis_decap invalid msg len %u < %u\n",
+                       printf("%s: urndis_decap invalid msg len %u < %zu\n",
                            DEVNAME(sc),
                            letoh32(msg->rm_len),
                            sizeof(*msg));
@@ -852,7 +852,7 @@ urndis_decap(struct urndis_softc *sc, struct urndis_chain 
*c, u_int32_t len)
                    letoh32(msg->rm_datalen) + RNDIS_HEADER_OFFSET 
                        > letoh32(msg->rm_len)) {
                        printf("%s: urndis_decap invalid data "
-                           "len/offset/end_position(%u/%u/%u) -> "
+                           "len/offset/end_position(%u/%u/%zu) -> "
                            "go out of receive buffer limit %u\n",
                            DEVNAME(sc),
                            letoh32(msg->rm_datalen),
@@ -866,7 +866,7 @@ urndis_decap(struct urndis_softc *sc, struct urndis_chain 
*c, u_int32_t len)
                if (letoh32(msg->rm_datalen) < sizeof(struct ether_header)) {
                        ifp->if_ierrors++;
                        printf("%s: urndis_decap invalid ethernet size "
-                           "%d < %d\n",
+                           "%u < %zu\n",
                            DEVNAME(sc),
                            letoh32(msg->rm_datalen),
                            sizeof(struct ether_header));
diff --git sys/netinet/ip_output.c sys/netinet/ip_output.c
index b59accf..43a0551 100644
--- sys/netinet/ip_output.c
+++ sys/netinet/ip_output.c
@@ -267,7 +267,7 @@ reroute:
        if (mtag != NULL) {
 #ifdef DIAGNOSTIC
                if (mtag->m_tag_len != sizeof (struct tdb_ident))
-                       panic("ip_output: tag of length %d (should be %d",
+                       panic("ip_output: tag of length %hu (should be %zu",
                            mtag->m_tag_len, sizeof (struct tdb_ident));
 #endif
                tdbi = (struct tdb_ident *)(mtag + 1);
diff --git sys/netinet6/ip6_forward.c sys/netinet6/ip6_forward.c
index 6d7f971..1dff149 100644
--- sys/netinet6/ip6_forward.c
+++ sys/netinet6/ip6_forward.c
@@ -160,7 +160,7 @@ reroute:
        if (mtag != NULL) {
 #ifdef DIAGNOSTIC
                if (mtag->m_tag_len != sizeof (struct tdb_ident))
-                       panic("ip6_forward: tag of length %d (should be %d",
+                       panic("ip6_forward: tag of length %hu (should be %zu",
                            mtag->m_tag_len, sizeof (struct tdb_ident));
 #endif
                tdbi = (struct tdb_ident *)(mtag + 1);
diff --git sys/netinet6/ip6_output.c sys/netinet6/ip6_output.c
index f405b31..baf4103 100644
--- sys/netinet6/ip6_output.c
+++ sys/netinet6/ip6_output.c
@@ -232,7 +232,7 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt, struct 
route_in6 *ro,
        if (mtag != NULL) {
 #ifdef DIAGNOSTIC
                if (mtag->m_tag_len != sizeof (struct tdb_ident))
-                       panic("ip6_output: tag of length %d (should be %d",
+                       panic("ip6_output: tag of length %hu (should be %zu",
                            mtag->m_tag_len, sizeof (struct tdb_ident));
 #endif
                tdbi = (struct tdb_ident *)(mtag + 1);
diff --git sys/nfs/nfs_socket.c sys/nfs/nfs_socket.c
index e0f28e4..e1f7b3d 100644
--- sys/nfs/nfs_socket.c
+++ sys/nfs/nfs_socket.c
@@ -600,7 +600,7 @@ tryagain:
                        } while (error == EWOULDBLOCK);
                        if (!error && auio.uio_resid > 0) {
                            log(LOG_INFO,
-                                "short receive (%d/%d) from nfs server %s\n",
+                                "short receive (%zd/%zd) from nfs server %s\n",
                                 sizeof(u_int32_t) - auio.uio_resid,
                                 sizeof(u_int32_t),
                                 rep->r_nmp->nm_mountp->mnt_stat.f_mntfromname);
@@ -631,7 +631,7 @@ tryagain:
                                 error == ERESTART);
                        if (!error && auio.uio_resid > 0) {
                            log(LOG_INFO,
-                               "short receive (%d/%d) from nfs server %s\n",
+                               "short receive (%zu/%u) from nfs server %s\n",
                                len - auio.uio_resid, len,
                                rep->r_nmp->nm_mountp->mnt_stat.f_mntfromname);
                            error = EPIPE;
-- 
1.7.6

Reply via email to