Use devtoname() to print dev_t's instead of casting them to long or u_long

for misprinting in %lx format.
This commit is contained in:
Bruce Evans 1999-08-23 20:35:21 +00:00
parent 80e6247e72
commit d918320517
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=50253
11 changed files with 61 additions and 58 deletions

View File

@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: scsi_da.c,v 1.33 1999/08/15 23:34:40 mjacob Exp $
* $Id: scsi_da.c,v 1.34 1999/08/21 06:23:50 msmith Exp $
*/
#include "opt_hw_wdog.h"
@ -282,7 +282,7 @@ daopen(dev_t dev, int flags, int fmt, struct proc *p)
softc = (struct da_softc *)periph->softc;
CAM_DEBUG(periph->path, CAM_DEBUG_TRACE,
("daopen: dev=0x%lx (unit %d , partition %d)\n", (long) dev,
("daopen: dev=%s (unit %d , partition %d)\n", devtoname(dev),
unit, part));
if ((error = cam_periph_lock(periph, PRIBIO|PCATCH)) != 0) {

View File

@ -4,7 +4,7 @@
* v1.4 by Eric S. Raymond (esr@snark.thyrsus.com) Aug 1993
* modified for FreeBSD by Andrew A. Chernov <ache@astral.msk.su>
*
* $Id: spkr.c,v 1.37 1999/05/31 11:26:32 phk Exp $
* $Id: spkr.c,v 1.38 1999/08/17 20:25:49 billf Exp $
*/
#include "speaker.h"
@ -563,8 +563,8 @@ spkrioctl(dev, cmd, cmdarg, flags, p)
struct proc *p;
{
#ifdef DEBUG
(void) printf("spkrioctl: entering with dev = %lx, cmd = %lx\n",
(unsigned long)dev, cmd);
(void) printf("spkrioctl: entering with dev = %s, cmd = %lx\n",
devtoname(dev), cmd);
#endif /* DEBUG */
if (minor(dev) != 0)

View File

@ -38,7 +38,7 @@
* from: Utah Hdr: vn.c 1.13 94/04/02
*
* from: @(#)vn.c 8.6 (Berkeley) 4/1/94
* $Id: vn.c,v 1.84 1999/08/14 11:40:38 phk Exp $
* $Id: vn.c,v 1.85 1999/08/23 09:35:12 phk Exp $
*/
/*
@ -216,8 +216,8 @@ vnopen(dev_t dev, int flags, int mode, struct proc *p)
vn = vnfindvn(dev);
IFOPT(vn, VN_FOLLOW)
printf("vnopen(0x%lx, 0x%x, 0x%x, %p)\n",
(u_long)dev, flags, mode, (void *)p);
printf("vnopen(%s, 0x%x, 0x%x, %p)\n",
devtoname(dev), flags, mode, (void *)p);
IFOPT(vn, VN_LABELS) {
if (vn->sc_flags & VNF_INITED) {
@ -373,9 +373,9 @@ vnioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
vn = dev->si_drv1;
IFOPT(vn,VN_FOLLOW)
printf("vnioctl(0x%lx, 0x%lx, %p, 0x%x, %p): unit %d\n",
(u_long)dev, cmd, (void *)data, flag, (void *)p,
dkunit(dev));
printf("vnioctl(%s, 0x%lx, %p, 0x%x, %p): unit %d\n",
devtoname(dev), cmd, (void *)data, flag, (void *)p,
dkunit(dev));
switch (cmd) {
case VNIOCATTACH:

View File

@ -113,8 +113,8 @@ ext2_alloc(ip, lbn, bpref, size, cred, bnp)
fs = ip->i_e2fs;
#if DIAGNOSTIC
if ((u_int)size > fs->s_blocksize || blkoff(fs, size) != 0) {
printf("dev = 0x%lx, bsize = %lu, size = %d, fs = %s\n",
(u_long)ip->i_dev, fs->s_blocksize, size, fs->fs_fsmnt);
printf("dev = %s, bsize = %lu, size = %d, fs = %s\n",
devtoname(ip->i_dev), fs->s_blocksize, size, fs->fs_fsmnt);
panic("ext2_alloc: bad size");
}
if (cred == NOCRED)

View File

@ -113,8 +113,8 @@ ext2_alloc(ip, lbn, bpref, size, cred, bnp)
fs = ip->i_e2fs;
#if DIAGNOSTIC
if ((u_int)size > fs->s_blocksize || blkoff(fs, size) != 0) {
printf("dev = 0x%lx, bsize = %lu, size = %d, fs = %s\n",
(u_long)ip->i_dev, fs->s_blocksize, size, fs->fs_fsmnt);
printf("dev = %s, bsize = %lu, size = %d, fs = %s\n",
devtoname(ip->i_dev), fs->s_blocksize, size, fs->fs_fsmnt);
panic("ext2_alloc: bad size");
}
if (cred == NOCRED)

View File

@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: istallion.c,v 1.28 1999/05/30 16:52:16 phk Exp $
* $Id: istallion.c,v 1.29 1999/05/31 11:26:09 phk Exp $
*/
/*****************************************************************************/
@ -1064,8 +1064,8 @@ STATIC int stliclose(dev_t dev, int flag, int mode, struct proc *p)
int x;
#if DEBUG
printf("stliclose(dev=%lx,flag=%x,mode=%x,p=%p)\n",
(unsigned long) dev, flag, mode, (void *) p);
printf("stliclose(dev=%s,flag=%x,mode=%x,p=%p)\n",
devtoname(dev), flag, mode, (void *) p);
#endif
if (minor(dev) & STL_MEMDEV)
@ -1092,7 +1092,7 @@ STATIC int stliread(dev_t dev, struct uio *uiop, int flag)
stliport_t *portp;
#if DEBUG
printf("stliread(dev=%lx,uiop=%p,flag=%x)\n", (unsigned long) dev,
printf("stliread(dev=%s,uiop=%p,flag=%x)\n", devtoname(dev),
(void *) uiop, flag);
#endif
@ -1149,7 +1149,7 @@ STATIC int stliwrite(dev_t dev, struct uio *uiop, int flag)
stliport_t *portp;
#if DEBUG
printf("stliwrite(dev=%lx,uiop=%p,flag=%x)\n", (unsigned long) dev,
printf("stliwrite(dev=%s,uiop=%p,flag=%x)\n", devtoname(dev),
(void *) uiop, flag);
#endif
@ -1175,8 +1175,8 @@ STATIC int stliioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag,
int error, i, x;
#if DEBUG
printf("stliioctl(dev=%lx,cmd=%lx,data=%p,flag=%x,p=%p)\n",
(unsigned long) dev, cmd, (void *) data, flag, (void *) p);
printf("stliioctl(dev=%s,cmd=%lx,data=%p,flag=%x,p=%p)\n",
devtoname(dev), cmd, (void *) data, flag, (void *) p);
#endif
if (minor(dev) & STL_MEMDEV)
@ -3829,8 +3829,8 @@ static int stli_memioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag,
int brdnr, rc;
#if DEBUG
printf("stli_memioctl(dev=%lx,cmd=%lx,data=%p,flag=%x)\n",
(unsigned long) dev, cmd, (void *) data, flag);
printf("stli_memioctl(dev=%s,cmd=%lx,data=%p,flag=%x)\n",
devtoname(dev), cmd, (void *) data, flag);
#endif
brdnr = minor(dev) & 0x7;

View File

@ -4,7 +4,7 @@
* v1.4 by Eric S. Raymond (esr@snark.thyrsus.com) Aug 1993
* modified for FreeBSD by Andrew A. Chernov <ache@astral.msk.su>
*
* $Id: spkr.c,v 1.37 1999/05/31 11:26:32 phk Exp $
* $Id: spkr.c,v 1.38 1999/08/17 20:25:49 billf Exp $
*/
#include "speaker.h"
@ -563,8 +563,8 @@ spkrioctl(dev, cmd, cmdarg, flags, p)
struct proc *p;
{
#ifdef DEBUG
(void) printf("spkrioctl: entering with dev = %lx, cmd = %lx\n",
(unsigned long)dev, cmd);
(void) printf("spkrioctl: entering with dev = %s, cmd = %lx\n",
devtoname(dev), cmd);
#endif /* DEBUG */
if (minor(dev) != 0)

View File

@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: stallion.c,v 1.32 1999/05/30 16:52:27 phk Exp $
* $Id: stallion.c,v 1.33 1999/05/31 11:26:33 phk Exp $
*/
/*****************************************************************************/
@ -886,7 +886,7 @@ STATIC int stlclose(dev_t dev, int flag, int mode, struct proc *p)
int x;
#if DEBUG
printf("stlclose(dev=%lx,flag=%x,mode=%x,p=%p)\n", (unsigned long) dev,
printf("stlclose(dev=%s,flag=%x,mode=%x,p=%p)\n", devtoname(dev),
flag, mode, (void *) p);
#endif
@ -914,7 +914,7 @@ STATIC int stlread(dev_t dev, struct uio *uiop, int flag)
stlport_t *portp;
#if DEBUG
printf("stlread(dev=%lx,uiop=%p,flag=%x)\n", (unsigned long) dev,
printf("stlread(dev=%s,uiop=%p,flag=%x)\n", devtoname(dev),
(void *) uiop, flag);
#endif
@ -968,7 +968,7 @@ STATIC int stlwrite(dev_t dev, struct uio *uiop, int flag)
stlport_t *portp;
#if DEBUG
printf("stlwrite(dev=%lx,uiop=%p,flag=%x)\n", (unsigned long) dev,
printf("stlwrite(dev=%s,uiop=%p,flag=%x)\n", devtoname(dev),
(void *) uiop, flag);
#endif
@ -989,8 +989,8 @@ STATIC int stlioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag,
int error, i, x;
#if DEBUG
printf("stlioctl(dev=%lx,cmd=%lx,data=%p,flag=%x,p=%p)\n",
(unsigned long) dev, cmd, (void *) data, flag, (void *) p);
printf("stlioctl(dev=%s,cmd=%lx,data=%p,flag=%x,p=%p)\n",
devtoname(dev), cmd, (void *) data, flag, (void *) p);
#endif
if (minor(dev) & STL_MEMDEV)
@ -3103,8 +3103,8 @@ static int stl_memioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag,
int brdnr, rc;
#if DEBUG
printf("stl_memioctl(dev=%lx,cmd=%lx,data=%p,flag=%x)\n",
(unsigned long) dev, cmd, (void *) data, flag);
printf("stl_memioctl(dev=%s,cmd=%lx,data=%p,flag=%x)\n",
devtoname(dev), cmd, (void *) data, flag);
#endif
brdnr = minor(dev) & 0x7;

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_shutdown.c 8.3 (Berkeley) 1/21/94
* $Id: kern_shutdown.c,v 1.60 1999/08/13 10:29:21 phk Exp $
* $Id: kern_shutdown.c,v 1.61 1999/08/21 06:24:20 msmith Exp $
*/
#include "opt_ddb.h"
@ -250,8 +250,8 @@ boot(howto)
BUF_REFCNT(bp) > 0) {
nbusy++;
printf(
"%d: dev:%08lx, flags:%08lx, blkno:%ld, lblkno:%ld\n",
nbusy, (u_long)bp->b_dev,
"%d: dev:%s, flags:%08lx, blkno:%ld, lblkno:%ld\n",
nbusy, devtoname(bp->b_dev),
bp->b_flags, (long)bp->b_blkno,
(long)bp->b_lblkno);
}

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_alloc.c 8.18 (Berkeley) 5/26/95
* $Id: ffs_alloc.c,v 1.57 1999/05/06 18:13:11 peter Exp $
* $Id: ffs_alloc.c,v 1.58 1999/05/12 22:32:07 peter Exp $
*/
#include "opt_quota.h"
@ -39,6 +39,7 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/buf.h>
#include <sys/conf.h>
#include <sys/proc.h>
#include <sys/vnode.h>
#include <sys/mount.h>
@ -114,8 +115,9 @@ ffs_alloc(ip, lbn, bpref, size, cred, bnp)
fs = ip->i_fs;
#ifdef DIAGNOSTIC
if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0) {
printf("dev = 0x%lx, bsize = %ld, size = %d, fs = %s\n",
(u_long)ip->i_dev, (long)fs->fs_bsize, size, fs->fs_fsmnt);
printf("dev = %s, bsize = %ld, size = %d, fs = %s\n",
devtoname(ip->i_dev), (long)fs->fs_bsize, size,
fs->fs_fsmnt);
panic("ffs_alloc: bad size");
}
if (cred == NOCRED)
@ -185,8 +187,8 @@ ffs_realloccg(ip, lbprev, bpref, osize, nsize, cred, bpp)
if ((u_int)osize > fs->fs_bsize || fragoff(fs, osize) != 0 ||
(u_int)nsize > fs->fs_bsize || fragoff(fs, nsize) != 0) {
printf(
"dev = 0x%lx, bsize = %ld, osize = %d, nsize = %d, fs = %s\n",
(u_long)ip->i_dev, (long)fs->fs_bsize, osize,
"dev = %s, bsize = %ld, osize = %d, nsize = %d, fs = %s\n",
devtoname(ip->i_dev), (long)fs->fs_bsize, osize,
nsize, fs->fs_fsmnt);
panic("ffs_realloccg: bad size");
}
@ -197,8 +199,8 @@ ffs_realloccg(ip, lbprev, bpref, osize, nsize, cred, bpp)
freespace(fs, fs->fs_minfree) - numfrags(fs, nsize - osize) < 0)
goto nospace;
if ((bprev = ip->i_db[lbprev]) == 0) {
printf("dev = 0x%lx, bsize = %ld, bprev = %ld, fs = %s\n",
(u_long)ip->i_dev, (long)fs->fs_bsize, (long)bprev,
printf("dev = %s, bsize = %ld, bprev = %ld, fs = %s\n",
devtoname(ip->i_dev), (long)fs->fs_bsize, (long)bprev,
fs->fs_fsmnt);
panic("ffs_realloccg: bad bprev");
}
@ -283,8 +285,8 @@ ffs_realloccg(ip, lbprev, bpref, osize, nsize, cred, bpp)
fs->fs_optim = FS_OPTSPACE;
break;
default:
printf("dev = 0x%lx, optim = %ld, fs = %s\n",
(u_long)ip->i_dev, (long)fs->fs_optim, fs->fs_fsmnt);
printf("dev = %s, optim = %ld, fs = %s\n",
devtoname(ip->i_dev), (long)fs->fs_optim, fs->fs_fsmnt);
panic("ffs_realloccg: bad optim");
/* NOTREACHED */
}
@ -1295,8 +1297,9 @@ ffs_blkfree(ip, bno, size)
VOP_FREEBLKS(ip->i_devvp, fsbtodb(fs, 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%lx, bno = %d, bsize = %d, size = %ld, fs = %s\n",
(u_long)ip->i_dev, bno, fs->fs_bsize, size, fs->fs_fsmnt);
printf("dev=%s, bno = %ld, bsize = %ld, size = %ld, fs = %s\n",
devtoname(ip->i_dev), (long)bno, (long)fs->fs_bsize, size,
fs->fs_fsmnt);
panic("ffs_blkfree: bad size");
}
cg = dtog(fs, bno);
@ -1322,8 +1325,8 @@ ffs_blkfree(ip, bno, size)
if (size == fs->fs_bsize) {
blkno = fragstoblks(fs, bno);
if (!ffs_isfreeblock(fs, cg_blksfree(cgp), blkno)) {
printf("dev = 0x%lx, block = %ld, fs = %s\n",
(u_long)ip->i_dev, (long)bno, fs->fs_fsmnt);
printf("dev = %s, block = %ld, fs = %s\n",
devtoname(ip->i_dev), (long)bno, fs->fs_fsmnt);
panic("ffs_blkfree: freeing free block");
}
ffs_setblock(fs, cg_blksfree(cgp), blkno);
@ -1347,8 +1350,8 @@ ffs_blkfree(ip, bno, size)
frags = numfrags(fs, size);
for (i = 0; i < frags; i++) {
if (isset(cg_blksfree(cgp), bno + i)) {
printf("dev = 0x%lx, block = %ld, fs = %s\n",
(u_long)ip->i_dev, (long)(bno + i),
printf("dev = %s, block = %ld, fs = %s\n",
devtoname(ip->i_dev), (long)(bno + i),
fs->fs_fsmnt);
panic("ffs_blkfree: freeing free frag");
}
@ -1482,8 +1485,8 @@ ffs_vfree( pvp, ino, mode)
cgp->cg_time = time_second;
ino %= fs->fs_ipg;
if (isclr(cg_inosused(cgp), ino)) {
printf("dev = 0x%lx, ino = %lu, fs = %s\n",
(u_long)pip->i_dev, (u_long)ino, fs->fs_fsmnt);
printf("dev = %s, ino = %lu, fs = %s\n",
devtoname(pip->i_dev), (u_long)ino, fs->fs_fsmnt);
if (fs->fs_ronly == 0)
panic("ffs_vfree: freeing free inode");
}

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_vnops.c 8.27 (Berkeley) 5/27/95
* $Id: ufs_vnops.c,v 1.119 1999/08/13 10:56:02 phk Exp $
* $Id: ufs_vnops.c,v 1.120 1999/08/22 00:15:16 jdp Exp $
*/
#include "opt_quota.h"
@ -1798,8 +1798,8 @@ ufs_print(ap)
register struct vnode *vp = ap->a_vp;
register struct inode *ip = VTOI(vp);
printf("tag VT_UFS, ino %lu, on dev %#lx (%d, %d)",
(u_long)ip->i_number, (u_long)ip->i_dev, major(ip->i_dev),
printf("tag VT_UFS, ino %lu, on dev %s (%d, %d)",
(u_long)ip->i_number, devtoname(ip->i_dev), major(ip->i_dev),
minor(ip->i_dev));
if (vp->v_type == VFIFO)
fifo_printinfo(vp);