Re: Removing -Wno-format from kernel makefiles, 06/16

2013-07-04 Thread Alexander Bluhm
On Thu, Jul 04, 2013 at 06:39:03PM +0200, Stefan Fritsch wrote:
> 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);

netinet and netinet6 is OK bluhm@

> 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);

This should be %zu/%zu

> @@ -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

Note that in nfs is another len that should be %u.

log(LOG_ERR, "%s (%d) from nfs server %s\n",
"impossible packet length",
len,
rep->r_nmp->nm_mountp->mnt_stat.f_mntfromname);

bluhm



Removing -Wno-format from kernel makefiles, 06/16

2013-07-04 Thread Stefan Fritsch
 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->