More printf format cleanup to reduce casts.

This commit is contained in:
tsutsui 2003-01-26 06:42:31 +00:00
parent ee04df9a4d
commit daf84696c6
2 changed files with 33 additions and 37 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ffs_alloc.c,v 1.58 2003/01/24 21:55:21 fvdl Exp $ */
/* $NetBSD: ffs_alloc.c,v 1.59 2003/01/26 06:42:31 tsutsui Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ffs_alloc.c,v 1.58 2003/01/24 21:55:21 fvdl Exp $");
__KERNEL_RCSID(0, "$NetBSD: ffs_alloc.c,v 1.59 2003/01/26 06:42:31 tsutsui Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ffs.h"
@ -242,8 +242,8 @@ ffs_realloccg(ip, lbprev, bpref, osize, nsize, cred, bpp, blknop)
goto nospace;
/* XXX ondisk32 */
if ((bprev = ufs_rw32(ip->i_ffs_db[lbprev], UFS_FSNEEDSWAP(fs))) == 0) {
printf("dev = 0x%x, bsize = %d, bprev = %lld, fs = %s\n",
ip->i_dev, fs->fs_bsize, (long long)bprev, fs->fs_fsmnt);
printf("dev = 0x%x, bsize = %d, bprev = %" PRId64 ", fs = %s\n",
ip->i_dev, fs->fs_bsize, bprev, fs->fs_fsmnt);
panic("ffs_realloccg: bad bprev");
}
/*
@ -1487,16 +1487,14 @@ ffs_blkfree(ip, bno, size)
if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0 ||
fragnum(fs, bno) + numfrags(fs, size) > fs->fs_frag) {
printf("dev = 0x%x, bno = %lld bsize = %d, "
printf("dev = 0x%x, bno = %" PRId64 " bsize = %d, "
"size = %ld, fs = %s\n",
ip->i_dev, (long long)bno, fs->fs_bsize, size,
fs->fs_fsmnt);
ip->i_dev, bno, fs->fs_bsize, size, fs->fs_fsmnt);
panic("blkfree: bad size");
}
cg = dtog(fs, bno);
if ((u_int)bno >= fs->fs_size) {
printf("bad block %lld, ino %d\n", (long long)bno,
ip->i_number);
printf("bad block %" PRId64 ", ino %d\n", bno, ip->i_number);
ffs_fserr(fs, ip->i_ffs_uid, "bad block");
return;
}
@ -1516,8 +1514,8 @@ ffs_blkfree(ip, bno, size)
if (size == fs->fs_bsize) {
blkno = fragstoblks(fs, bno);
if (!ffs_isfreeblock(fs, cg_blksfree(cgp, needswap), blkno)) {
printf("dev = 0x%x, block = %lld, fs = %s\n",
ip->i_dev, (long long)bno, fs->fs_fsmnt);
printf("dev = 0x%x, block = %" PRId64 ", fs = %s\n",
ip->i_dev, bno, fs->fs_fsmnt);
panic("blkfree: freeing free block");
}
ffs_setblock(fs, cg_blksfree(cgp, needswap), blkno);
@ -1542,9 +1540,9 @@ ffs_blkfree(ip, bno, size)
frags = numfrags(fs, size);
for (i = 0; i < frags; i++) {
if (isset(cg_blksfree(cgp, needswap), bno + i)) {
printf("dev = 0x%x, block = %lld, fs = %s\n",
ip->i_dev, (long long)(bno + i),
fs->fs_fsmnt);
printf("dev = 0x%x, block = %" PRId64
", fs = %s\n",
ip->i_dev, bno + i, fs->fs_fsmnt);
panic("blkfree: freeing free frag");
}
setbit(cg_blksfree(cgp, needswap), bno + i);
@ -1787,7 +1785,7 @@ ffs_mapsearch(fs, cgp, bpref, allocsiz)
subfield <<= 1;
}
}
printf("bno = %lld, fs = %s\n", (long long)bno, fs->fs_fsmnt);
printf("bno = %" PRId64 ", fs = %s\n", bno, fs->fs_fsmnt);
panic("ffs_alloccg: block not in map");
/* return (-1); */
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ffs_softdep.c,v 1.41 2003/01/25 18:12:32 tron Exp $ */
/* $NetBSD: ffs_softdep.c,v 1.42 2003/01/26 06:42:32 tsutsui Exp $ */
/*
* Copyright 1998 Marshall Kirk McKusick. All Rights Reserved.
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ffs_softdep.c,v 1.41 2003/01/25 18:12:32 tron Exp $");
__KERNEL_RCSID(0, "$NetBSD: ffs_softdep.c,v 1.42 2003/01/26 06:42:32 tsutsui Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@ -1398,8 +1398,8 @@ softdep_setup_allocdirect(ip, lbn, newblkno, oldblkno, newsize, oldsize, bp)
if (bp == NULL) {
bp = softdep_setup_pagecache(ip, lbn, newsize);
UVMHIST_LOG(ubchist, "bp = %p, size = %d -> %d",
bp, (int)oldsize, (int)newsize, 0);
UVMHIST_LOG(ubchist, "bp = %p, size = %ld -> %ld",
bp, oldsize, newsize, 0);
}
ACQUIRE_LOCK(&lk);
(void) inodedep_lookup(ip->i_fs, ip->i_number, DEPALLOC, &inodedep);
@ -1490,13 +1490,13 @@ allocdirect_merge(adphead, newadp, oldadp)
if (newadp->ad_oldblkno != oldadp->ad_newblkno ||
newadp->ad_oldsize != oldadp->ad_newsize ||
newadp->ad_lbn >= NDADDR)
panic("allocdirect_merge: ob %lld != nb %lld || "
"lbn %d >= %d ||\nosize %lu != nsize %lu",
(long long)newadp->ad_oldblkno,
(long long)oldadp->ad_newblkno,
(int)newadp->ad_lbn, NDADDR,
(unsigned long)newadp->ad_oldsize,
(unsigned long)oldadp->ad_newsize);
panic("allocdirect_merge: ob %" PRId64 " != nb %" PRId64 " || "
"lbn %" PRId64 " >= %d ||\nosize %ld != nsize %ld",
newadp->ad_oldblkno,
oldadp->ad_newblkno,
newadp->ad_lbn, NDADDR,
newadp->ad_oldsize,
oldadp->ad_newsize);
newadp->ad_oldblkno = oldadp->ad_oldblkno;
newadp->ad_oldsize = oldadp->ad_oldsize;
/*
@ -3430,8 +3430,7 @@ initiate_write_inodeblock(inodedep, bp)
panic("%s: indirect pointer #%d mismatch %d != %" PRId64,
"softdep_write_inodeblock",
(int)(adp->ad_lbn - NDADDR),
(int)ufs_rw32(dp->di_ib[adp->ad_lbn - NDADDR],
needswap),
ufs_rw32(dp->di_ib[adp->ad_lbn - NDADDR], needswap),
adp->ad_newblkno);
deplist |= 1 << adp->ad_lbn;
if ((adp->ad_state & ATTACHED) == 0)
@ -3796,7 +3795,7 @@ handle_written_inodeblock(inodedep, bp)
"handle_written_inodeblock",
"direct pointer", (int)adp->ad_lbn,
ufs_rw32(dp->di_db[adp->ad_lbn], needswap),
(long long)adp->ad_oldblkno);
adp->ad_oldblkno);
/* XXX ondisk32 */
dp->di_db[adp->ad_lbn] =
ufs_rw32((int32_t)adp->ad_newblkno, needswap);
@ -5292,8 +5291,8 @@ softdep_setup_pagecache(ip, lbn, size)
LIST_INSERT_HEAD(&ip->i_pcbufhd, bp, b_vnbufs);
}
bp->b_bcount = bp->b_resid = size;
UVMHIST_LOG(ubchist, "vp = %p, lbn = %d, bp = %p, bcount = resid = %ld",
vp, (int)lbn, bp, size);
UVMHIST_LOG(ubchist, "vp = %p, lbn = %" PRId64
", bp = %p, bcount = resid = %ld", vp, lbn, bp, size);
return bp;
}
@ -5439,19 +5438,18 @@ softdep_pageiodone1(bp)
continue;
}
UVMHIST_LOG(ubchist,
"bcount %d resid %d vp %p lbn %ld",
pcbp ? (int)pcbp->b_bcount : -1,
pcbp ? (int)pcbp->b_resid : -1, vp, lbn);
"bcount %ld resid %ld vp %p lbn %" PRId64,
pcbp ? pcbp->b_bcount : -1,
pcbp ? pcbp->b_resid : -1, vp, lbn);
UVMHIST_LOG(ubchist,
"pcbp %p iosize %ld, size %d, asize %d",
pcbp, iosize, size, asize);
pcbp->b_resid -= size;
if (pcbp->b_resid < 0) {
panic("softdep_pageiodone: "
"resid < 0, vp %p lbn 0x%llx pcbp %p"
"resid < 0, vp %p lbn 0x%" PRIx64 " pcbp %p"
" iosize %ld, size %d, asize %d, bsize %d",
vp, (long long)lbn, pcbp, iosize, size,
asize, bsize);
vp, lbn, pcbp, iosize, size, asize, bsize);
}
if (pcbp->b_resid > 0) {
continue;