summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-07-29 17:38:14 +0000
committerbde <bde@FreeBSD.org>1998-07-29 17:38:14 +0000
commit57b661836aae1698e2f0388e6462e8f1521b801d (patch)
tree9d6b5e21e6afa66e7b770366c1471181303961a1
parent690e655ec2e48e3998b33a9edfaa8ba85ccce301 (diff)
downloadFreeBSD-src-57b661836aae1698e2f0388e6462e8f1521b801d.zip
FreeBSD-src-57b661836aae1698e2f0388e6462e8f1521b801d.tar.gz
Fixed printf format errors.
-rw-r--r--sys/kern/kern_descrip.c8
-rw-r--r--sys/kern/kern_lkm.c9
-rw-r--r--sys/kern/kern_lockf.c73
-rw-r--r--sys/kern/kern_malloc.c15
-rw-r--r--sys/kern/vfs_cluster.c24
5 files changed, 68 insertions, 61 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index f7d5136..e3d736b 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_descrip.c 8.6 (Berkeley) 4/19/94
- * $Id: kern_descrip.c,v 1.53 1998/06/10 10:27:43 dfr Exp $
+ * $Id: kern_descrip.c,v 1.54 1998/07/15 06:10:16 bde Exp $
*/
#include "opt_compat.h"
@@ -1189,15 +1189,15 @@ static void fildesc_drvinit(void *unused)
devfs_token_stdin =
devfs_add_devswf(&fildesc_cdevsw, 0, DV_CHR,
UID_ROOT, GID_WHEEL, 0666,
- "stdin", fd);
+ "stdin");
devfs_token_stdout =
devfs_add_devswf(&fildesc_cdevsw, 1, DV_CHR,
UID_ROOT, GID_WHEEL, 0666,
- "stdout", fd);
+ "stdout");
devfs_token_stderr =
devfs_add_devswf(&fildesc_cdevsw, 2, DV_CHR,
UID_ROOT, GID_WHEEL, 0666,
- "stderr", fd);
+ "stderr");
#endif
}
}
diff --git a/sys/kern/kern_lkm.c b/sys/kern/kern_lkm.c
index 7cbde12..3b4731a 100644
--- a/sys/kern/kern_lkm.c
+++ b/sys/kern/kern_lkm.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kern_lkm.c,v 1.50 1998/06/25 11:27:36 phk Exp $
+ * $Id: kern_lkm.c,v 1.51 1998/07/15 06:39:12 bde Exp $
*/
#include "opt_devfs.h"
@@ -238,7 +238,7 @@ lkmcioctl(dev, cmd, data, flag, p)
resrvp->addr = curp->area; /* ret kernel addr */
#ifdef DEBUG
- printf("LKM: LMRESERV (actual = 0x%08x)\n", curp->area);
+ printf("LKM: LMRESERV (actual = %8p)\n", (void *)curp->area);
printf("LKM: LMRESERV (adjusted = 0x%08x)\n",
trunc_page(curp->area));
#endif /* DEBUG */
@@ -269,8 +269,9 @@ lkmcioctl(dev, cmd, data, flag, p)
if ((curp->offset + i) < curp->size) {
lkm_state = LKMS_LOADING;
#ifdef DEBUG
- printf("LKM: LMLOADBUF (loading @ %d of %d, i = %d)\n",
- curp->offset, curp->size, i);
+ printf(
+ "LKM: LMLOADBUF (loading @ %lu of %lu, i = %d)\n",
+ curp->offset, curp->size, i);
#endif /* DEBUG */
} else {
lkm_state = LKMS_LOADED;
diff --git a/sys/kern/kern_lockf.c b/sys/kern/kern_lockf.c
index 06fdb92..bc73d38 100644
--- a/sys/kern/kern_lockf.c
+++ b/sys/kern/kern_lockf.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_lockf.c 8.3 (Berkeley) 1/6/94
- * $Id: kern_lockf.c,v 1.17 1997/12/05 19:55:38 bde Exp $
+ * $Id: kern_lockf.c,v 1.18 1998/01/31 07:23:11 eivind Exp $
*/
#include "opt_debug_lockf.h"
@@ -737,21 +737,22 @@ lf_print(tag, lock)
register struct lockf *lock;
{
- printf("%s: lock 0x%lx for ", tag, lock);
+ printf("%s: lock %p for ", tag, (void *)lock);
if (lock->lf_flags & F_POSIX)
- printf("proc %d", ((struct proc *)(lock->lf_id))->p_pid);
+ printf("proc %ld", (long)((struct proc *)lock->lf_id)->p_pid);
else
- printf("id 0x%x", lock->lf_id);
- printf(" in ino %d on dev <%d, %d>, %s, start %d, end %d",
- lock->lf_inode->i_number,
- major(lock->lf_inode->i_dev),
- minor(lock->lf_inode->i_dev),
- lock->lf_type == F_RDLCK ? "shared" :
- lock->lf_type == F_WRLCK ? "exclusive" :
- lock->lf_type == F_UNLCK ? "unlock" :
- "unknown", lock->lf_start, lock->lf_end);
+ printf("id %p", (void *)lock->lf_id);
+ /* XXX no %qd in kernel. Truncate. */
+ printf(" in ino %lu on dev <%d, %d>, %s, start %ld, end %ld",
+ (u_long)lock->lf_inode->i_number,
+ major(lock->lf_inode->i_dev),
+ minor(lock->lf_inode->i_dev),
+ lock->lf_type == F_RDLCK ? "shared" :
+ lock->lf_type == F_WRLCK ? "exclusive" :
+ lock->lf_type == F_UNLCK ? "unlock" :
+ "unknown", (long)lock->lf_start, (long)lock->lf_end);
if (lock->lf_blkhd.tqh_first)
- printf(" block 0x%x\n", lock->lf_blkhd.tqh_first);
+ printf(" block %p\n", (void *)lock->lf_blkhd.tqh_first);
else
printf("\n");
}
@@ -763,34 +764,38 @@ lf_printlist(tag, lock)
{
register struct lockf *lf, *blk;
- printf("%s: Lock list for ino %d on dev <%d, %d>:\n",
- tag, lock->lf_inode->i_number,
- major(lock->lf_inode->i_dev),
- minor(lock->lf_inode->i_dev));
+ printf("%s: Lock list for ino %lu on dev <%d, %d>:\n",
+ tag, (u_long)lock->lf_inode->i_number,
+ major(lock->lf_inode->i_dev),
+ minor(lock->lf_inode->i_dev));
for (lf = lock->lf_inode->i_lockf; lf; lf = lf->lf_next) {
- printf("\tlock 0x%lx for ", lf);
+ printf("\tlock %p for ",(void *)lf);
if (lf->lf_flags & F_POSIX)
- printf("proc %d", ((struct proc *)(lf->lf_id))->p_pid);
+ printf("proc %ld",
+ (long)((struct proc *)lf->lf_id)->p_pid);
else
- printf("id 0x%x", lf->lf_id);
- printf(", %s, start %d, end %d",
- lf->lf_type == F_RDLCK ? "shared" :
- lf->lf_type == F_WRLCK ? "exclusive" :
- lf->lf_type == F_UNLCK ? "unlock" :
- "unknown", lf->lf_start, lf->lf_end);
+ printf("id %p", (void *)lf->lf_id);
+ /* XXX no %qd in kernel. Truncate. */
+ printf(", %s, start %ld, end %ld",
+ lf->lf_type == F_RDLCK ? "shared" :
+ lf->lf_type == F_WRLCK ? "exclusive" :
+ lf->lf_type == F_UNLCK ? "unlock" :
+ "unknown", (long)lf->lf_start, (long)lf->lf_end);
for (blk = lf->lf_blkhd.tqh_first; blk;
blk = blk->lf_block.tqe_next) {
- printf("\n\t\tlock request 0x%lx for ", blk);
+ printf("\n\t\tlock request %p for ", (void *)blk);
if (blk->lf_flags & F_POSIX)
- printf("proc %d",
- ((struct proc *)(blk->lf_id))->p_pid);
+ printf("proc %ld",
+ (long)((struct proc *)blk->lf_id)->p_pid);
else
- printf("id 0x%x", blk->lf_id);
- printf(", %s, start %d, end %d",
- blk->lf_type == F_RDLCK ? "shared" :
- blk->lf_type == F_WRLCK ? "exclusive" :
- blk->lf_type == F_UNLCK ? "unlock" :
- "unknown", blk->lf_start, blk->lf_end);
+ printf("id %p", (void *)blk->lf_id);
+ /* XXX no %qd in kernel. Truncate. */
+ printf(", %s, start %ld, end %ld",
+ blk->lf_type == F_RDLCK ? "shared" :
+ blk->lf_type == F_WRLCK ? "exclusive" :
+ blk->lf_type == F_UNLCK ? "unlock" :
+ "unknown", (long)blk->lf_start,
+ (long)blk->lf_end);
if (blk->lf_blkhd.tqh_first)
panic("lf_printlist: bad list");
}
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c
index 7d0746f..c7a25d9 100644
--- a/sys/kern/kern_malloc.c
+++ b/sys/kern/kern_malloc.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)kern_malloc.c 8.3 (Berkeley) 1/4/94
- * $Id: kern_malloc.c,v 1.44 1998/02/23 07:41:23 dyson Exp $
+ * $Id: kern_malloc.c,v 1.45 1998/03/08 09:56:49 julian Exp $
*/
#include "opt_vm.h"
@@ -213,9 +213,10 @@ malloc(size, type, flags)
for (lp = (long *)va; lp < end; lp++) {
if (*lp == WEIRD_ADDR)
continue;
- printf("%s %d of object %p size %ld %s %s (0x%lx != 0x%x)\n",
- "Data modified on freelist: word", lp - (long *)va,
- va, size, "previous type", savedtype, *lp, WEIRD_ADDR);
+ printf("%s %ld of object %p size %lu %s %s (0x%lx != 0x%lx)\n",
+ "Data modified on freelist: word",
+ (long)(lp - (long *)va), (void *)va, size,
+ "previous type", savedtype, *lp, (u_long)WEIRD_ADDR);
break;
}
freep->spare0 = 0;
@@ -262,7 +263,7 @@ free(addr, type)
#ifdef DIAGNOSTIC
if ((char *)addr < kmembase || (char *)addr >= kmemlimit) {
- panic("free: address 0x%x out of range", addr);
+ panic("free: address %p out of range", (void *)addr);
}
#endif
kup = btokup(addr);
@@ -279,8 +280,8 @@ free(addr, type)
else
alloc = addrmask[kup->ku_indx];
if (((u_long)addr & alloc) != 0)
- panic("free: unaligned addr 0x%x, size %d, type %s, mask %d",
- addr, size, type->ks_shortdesc, alloc);
+ panic("free: unaligned addr %p, size %ld, type %s, mask %ld",
+ (void *)addr, size, type->ks_shortdesc, alloc);
#endif /* DIAGNOSTIC */
if (size > MAXALLOCSAVE) {
kmem_free(kmem_map, (vm_offset_t)addr, ctob(kup->ku_pagecnt));
diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c
index 3ea15a4..0ab55fa 100644
--- a/sys/kern/vfs_cluster.c
+++ b/sys/kern/vfs_cluster.c
@@ -33,7 +33,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_cluster.c 8.7 (Berkeley) 2/13/94
- * $Id: vfs_cluster.c,v 1.64 1998/07/07 04:36:23 bde Exp $
+ * $Id: vfs_cluster.c,v 1.65 1998/07/11 10:45:45 bde Exp $
*/
#include "opt_debug_cluster.h"
@@ -245,8 +245,8 @@ single_block_read:
if (bp) {
#if defined(CLUSTERDEBUG)
if (rcluster)
- printf("S(%d,%d,%d) ",
- bp->b_lblkno, bp->b_bcount, seqcount);
+ printf("S(%ld,%ld,%d) ",
+ (long)bp->b_lblkno, bp->b_bcount, seqcount);
#endif
if ((bp->b_flags & B_CLUSTER) == 0)
vfs_busy_pages(bp, 0);
@@ -268,15 +268,15 @@ single_block_read:
#if defined(CLUSTERDEBUG)
if (rcluster) {
if (bp)
- printf("A+(%d,%d,%d,%d) ",
- rbp->b_lblkno, rbp->b_bcount,
- rbp->b_lblkno - origblkno,
- seqcount);
+ printf("A+(%ld,%ld,%ld,%d) ",
+ (long)rbp->b_lblkno, rbp->b_bcount,
+ (long)(rbp->b_lblkno - origblkno),
+ seqcount);
else
- printf("A(%d,%d,%d,%d) ",
- rbp->b_lblkno, rbp->b_bcount,
- rbp->b_lblkno - origblkno,
- seqcount);
+ printf("A(%ld,%ld,%ld,%d) ",
+ (long)rbp->b_lblkno, rbp->b_bcount,
+ (long)(rbp->b_lblkno - origblkno),
+ seqcount);
}
#endif
@@ -313,7 +313,7 @@ cluster_rbuild(vp, filesize, lbn, blkno, size, run, fbp)
#ifdef DIAGNOSTIC
if (size != vp->v_mount->mnt_stat.f_iosize)
- panic("cluster_rbuild: size %d != filesize %d\n",
+ panic("cluster_rbuild: size %ld != filesize %ld\n",
size, vp->v_mount->mnt_stat.f_iosize);
#endif
/*
OpenPOWER on IntegriCloud