From: krw Date: Fri, 23 Oct 2015 17:21:34 +0000 (+0000) Subject: Fix printf() types so kernel compiles with or w/o MSDOSFS_DEBUG. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=81ad5374c07c0114b64d0071fe92defea1e2ba19;p=openbsd Fix printf() types so kernel compiles with or w/o MSDOSFS_DEBUG. e.g. print pointers with %p instead of %08x. No changes outside of MSDOSFS_DEBUG. --- diff --git a/sys/msdosfs/msdosfs_denode.c b/sys/msdosfs/msdosfs_denode.c index b5d141cb845..cdb15695617 100644 --- a/sys/msdosfs/msdosfs_denode.c +++ b/sys/msdosfs/msdosfs_denode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msdosfs_denode.c,v 1.54 2015/10/23 10:45:31 krw Exp $ */ +/* $OpenBSD: msdosfs_denode.c,v 1.55 2015/10/23 17:21:34 krw Exp $ */ /* $NetBSD: msdosfs_denode.c,v 1.23 1997/10/17 11:23:58 ws Exp $ */ /*- @@ -192,7 +192,7 @@ deget(struct msdosfsmount *pmp, uint32_t dirclust, uint32_t diroffset, struct proc *p = curproc; /* XXX */ #ifdef MSDOSFS_DEBUG - printf("deget(pmp %08x, dirclust %d, diroffset %x, depp %08x)\n", + printf("deget(pmp %p, dirclust %d, diroffset %x, depp %p)\n", pmp, dirclust, diroffset, depp); #endif @@ -390,7 +390,7 @@ detrunc(struct denode *dep, uint32_t length, int flags, struct ucred *cred, struct msdosfsmount *pmp = dep->de_pmp; #ifdef MSDOSFS_DEBUG - printf("detrunc(): file %.11s, length %ld, flags %d\n", + printf("detrunc(): file %.11s, length %u, flags %d\n", dep->de_Name, length, flags); #endif @@ -592,7 +592,7 @@ msdosfs_reclaim(void *v) #endif #ifdef MSDOSFS_DEBUG - printf("msdosfs_reclaim(): dep %08x, file %.11s, refcnt %d\n", + printf("msdosfs_reclaim(): dep %p, file %.11s, refcnt %ld\n", dep, dep->de_Name, dep->de_refcnt); #endif @@ -632,7 +632,7 @@ msdosfs_inactive(void *v) #endif #ifdef MSDOSFS_DEBUG - printf("msdosfs_inactive(): dep %08x, de_Name[0] %x\n", dep, + printf("msdosfs_inactive(): dep %p, de_Name[0] %x\n", dep, dep->de_Name[0]); #endif @@ -650,8 +650,9 @@ msdosfs_inactive(void *v) * as empty. (This may not be necessary for the dos filesystem.) */ #ifdef MSDOSFS_DEBUG - printf("msdosfs_inactive(): dep %08x, refcnt %d, mntflag %x, MNT_RDONLY %x\n", - dep, dep->de_refcnt, vp->v_mount->mnt_flag, MNT_RDONLY); + printf("msdosfs_inactive(): dep %p, refcnt %ld, mntflag %x, " + "MNT_RDONLY %x\n", dep, dep->de_refcnt, vp->v_mount->mnt_flag, + MNT_RDONLY); #endif if (dep->de_refcnt <= 0 && (vp->v_mount->mnt_flag & MNT_RDONLY) == 0) { error = detrunc(dep, (uint32_t)0, 0, NOCRED, NULL); diff --git a/sys/msdosfs/msdosfs_fat.c b/sys/msdosfs/msdosfs_fat.c index 0da897d5b66..3a3d4de0761 100644 --- a/sys/msdosfs/msdosfs_fat.c +++ b/sys/msdosfs/msdosfs_fat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msdosfs_fat.c,v 1.27 2015/10/23 10:45:31 krw Exp $ */ +/* $OpenBSD: msdosfs_fat.c,v 1.28 2015/10/23 17:21:34 krw Exp $ */ /* $NetBSD: msdosfs_fat.c,v 1.26 1997/10/17 11:24:02 ws Exp $ */ /*- @@ -325,7 +325,7 @@ updatefats(struct msdosfsmount *pmp, struct buf *bp, uint32_t fatbn) struct buf *bpn; #ifdef MSDOSFS_DEBUG - printf("updatefats(pmp %08, buf %x, fatbn %ld)\n", pmp, bp, fatbn); + printf("updatefats(pmp %p, buf %p, fatbn %d)\n", pmp, bp, fatbn); #endif /* @@ -471,8 +471,8 @@ fatentry(int function, struct msdosfsmount *pmp, uint32_t cn, uint32_t *oldconte struct buf *bp; #ifdef MSDOSFS_DEBUG - printf("fatentry(func %d, pmp %08x, clust %d, oldcon %08x, newcon %d)\n", - function, pmp, cn, oldcontents, newcontents); + printf("fatentry(func %d, pmp %p, clust %d, oldcon %p, " + "newcon %d)\n", function, pmp, cn, oldcontents, newcontents); #endif #ifdef DIAGNOSTIC @@ -572,7 +572,7 @@ fatchain(struct msdosfsmount *pmp, uint32_t start, uint32_t count, uint32_t fill struct buf *bp; #ifdef MSDOSFS_DEBUG - printf("fatchain(pmp %08x, start %d, count %d, fillwith %d)\n", + printf("fatchain(pmp %p, start %d, count %d, fillwith %d)\n", pmp, start, count, fillwith); #endif /* diff --git a/sys/msdosfs/msdosfs_lookup.c b/sys/msdosfs/msdosfs_lookup.c index 131530be1c3..ddd293482e1 100644 --- a/sys/msdosfs/msdosfs_lookup.c +++ b/sys/msdosfs/msdosfs_lookup.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msdosfs_lookup.c,v 1.28 2015/10/23 10:45:31 krw Exp $ */ +/* $OpenBSD: msdosfs_lookup.c,v 1.29 2015/10/23 17:21:34 krw Exp $ */ /* $NetBSD: msdosfs_lookup.c,v 1.34 1997/10/18 22:12:27 ws Exp $ */ /*- @@ -126,7 +126,7 @@ msdosfs_lookup(void *v) lockparent = flags & LOCKPARENT; wantparent = flags & (LOCKPARENT | WANTPARENT); #ifdef MSDOSFS_DEBUG - printf("msdosfs_lookup(): vdp %08x, dp %08x, Attr %02x\n", + printf("msdosfs_lookup(): vdp %p, dp %p, Attr %02x\n", vdp, dp, dp->de_Attributes); #endif @@ -194,8 +194,8 @@ msdosfs_lookup(void *v) slotcount = 0; #ifdef MSDOSFS_DEBUG - printf("msdosfs_lookup(): dos version of filename '%.11s', length %d\n", - dosfilename, cnp->cn_namelen); + printf("msdosfs_lookup(): dos version of filename '%.11s', " + "length %ld\n", dosfilename, cnp->cn_namelen); #endif /* @@ -364,7 +364,7 @@ notfound:; * the pathname and the directory hasn't been removed. */ #ifdef MSDOSFS_DEBUG - printf("msdosfs_lookup(): op %d, refcnt %d\n", + printf("msdosfs_lookup(): op %d, refcnt %ld\n", nameiop, dp->de_refcnt); printf(" slotcount %d, slotoffset %d\n", slotcount, slotoffset); @@ -606,7 +606,7 @@ createde(struct denode *dep, struct denode *ddep, struct denode **depp, int blsize; #ifdef MSDOSFS_DEBUG - printf("createde(dep %08x, ddep %08x, depp %08x, cnp %08x)\n", + printf("createde(dep %p, ddep %p, depp %p, cnp %p)\n", dep, ddep, depp, cnp); #endif @@ -938,7 +938,7 @@ removede(struct denode *pdep, struct denode *dep) uint32_t offset = pdep->de_fndoffset; #ifdef MSDOSFS_DEBUG - printf("removede(): filename %.11s, dep %08x, offset %08x\n", + printf("removede(): filename %.11s, dep %p, offset %x\n", dep->de_Name, dep, offset); #endif diff --git a/sys/msdosfs/msdosfs_vfsops.c b/sys/msdosfs/msdosfs_vfsops.c index 9da6261e045..a8d6a53f03b 100644 --- a/sys/msdosfs/msdosfs_vfsops.c +++ b/sys/msdosfs/msdosfs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msdosfs_vfsops.c,v 1.72 2015/10/23 10:45:31 krw Exp $ */ +/* $OpenBSD: msdosfs_vfsops.c,v 1.73 2015/10/23 17:21:34 krw Exp $ */ /* $NetBSD: msdosfs_vfsops.c,v 1.48 1997/10/18 02:54:57 briggs Exp $ */ /*- @@ -261,7 +261,7 @@ msdosfs_mount(struct mount *mp, const char *path, void *data, bcopy(&args, &mp->mnt_stat.mount_info.msdosfs_args, sizeof(args)); #ifdef MSDOSFS_DEBUG - printf("msdosfs_mount(): mp %x, pmp %x, inusemap %x\n", mp, + printf("msdosfs_mount(): mp %p, pmp %p, inusemap %p\n", mp, pmp, pmp->pm_inusemap); #endif @@ -647,7 +647,7 @@ msdosfs_root(struct mount *mp, struct vnode **vpp) return (error); #ifdef MSDOSFS_DEBUG - printf("msdosfs_root(); mp %08x, pmp %08x, ndep %08x, vp %08x\n", + printf("msdosfs_root(); mp %p, pmp %p, ndep %p, vp %p\n", mp, pmp, ndep, DETOV(ndep)); #endif diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c index 7a93c80b51c..55e50c259ca 100644 --- a/sys/msdosfs/msdosfs_vnops.c +++ b/sys/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msdosfs_vnops.c,v 1.102 2015/10/23 10:45:31 krw Exp $ */ +/* $OpenBSD: msdosfs_vnops.c,v 1.103 2015/10/23 17:21:34 krw Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.63 1997/10/17 11:24:19 ws Exp $ */ /*- @@ -120,7 +120,7 @@ msdosfs_create(void *v) struct timespec ts; #ifdef MSDOSFS_DEBUG - printf("msdosfs_create(cnp %08x, vap %08x\n", cnp, ap->a_vap); + printf("msdosfs_create(cnp %p, vap %p\n", cnp, ap->a_vap); #endif /* @@ -350,7 +350,7 @@ msdosfs_setattr(void *v) int error = 0; #ifdef MSDOSFS_DEBUG - printf("msdosfs_setattr(): vp %08x, vap %08x, cred %08x, p %08x\n", + printf("msdosfs_setattr(): vp %p, vap %p, cred %p, p %p\n", ap->a_vp, vap, cred, ap->a_p); #endif if ((vap->va_type != VNON) || (vap->va_nlink != VNOVAL) || @@ -359,10 +359,13 @@ msdosfs_setattr(void *v) (vap->va_bytes != VNOVAL) || (vap->va_gen != VNOVAL)) { #ifdef MSDOSFS_DEBUG printf("msdosfs_setattr(): returning EINVAL\n"); - printf(" va_type %d, va_nlink %x, va_fsid %x, va_fileid %x\n", - vap->va_type, vap->va_nlink, vap->va_fsid, vap->va_fileid); - printf(" va_blocksize %x, va_rdev %x, va_bytes %x, va_gen %x\n", - vap->va_blocksize, vap->va_rdev, vap->va_bytes, vap->va_gen); + printf(" va_type %d, va_nlink %x, va_fsid %ld, " + "va_fileid %llx\n", vap->va_type, vap->va_nlink, + vap->va_fsid, (unsigned long long)vap->va_fileid); + printf(" va_blocksize %lx, va_rdev %x, va_bytes %llx, " + "va_gen %lx\n", vap->va_blocksize, + (unsigned int)vap->va_rdev, + (unsigned long long)vap->va_bytes, vap->va_gen); #endif return (EINVAL); } @@ -612,7 +615,7 @@ msdosfs_write(void *v) struct ucred *cred = ap->a_cred; #ifdef MSDOSFS_DEBUG - printf("msdosfs_write(vp %08x, uio %08x, ioflag %08x, cred %08x\n", + printf("msdosfs_write(vp %p, uio %p, ioflag %08x, cred %p\n", vp, uio, ioflag, cred); printf("msdosfs_write(): diroff %d, dirclust %d, startcluster %d\n", dep->de_diroffset, dep->de_dirclust, dep->de_StartCluster); @@ -852,7 +855,8 @@ msdosfs_remove(void *v) VN_KNOTE(ap->a_dvp, NOTE_WRITE); #ifdef MSDOSFS_DEBUG - printf("msdosfs_remove(), dep %08x, v_usecount %d\n", dep, ap->a_vp->v_usecount); + printf("msdosfs_remove(), dep %p, v_usecount %d\n", dep, + ap->a_vp->v_usecount); #endif if (ddep == dep) vrele(ap->a_vp); @@ -1487,7 +1491,7 @@ msdosfs_readdir(void *v) int chksum = -1; #ifdef MSDOSFS_DEBUG - printf("msdosfs_readdir(): vp %08x, uio %08x, cred %08x, eofflagp %08x\n", + printf("msdosfs_readdir(): vp %p, uio %p, cred %p, eofflagp %p\n", ap->a_vp, uio, ap->a_cred, ap->a_eofflag); #endif