diff options
author | 2013-03-23 16:08:27 +0000 | |
---|---|---|
committer | 2013-03-23 16:08:27 +0000 | |
commit | 209ccf4d11ca3e62124dc6964029fcc729c0711f (patch) | |
tree | 5cd14184cfabf3addb91705b91a53f5ad86fdb7a | |
parent | convert a DEV_BSHIFT use to DEV_BSIZE (this .h file is reused in (diff) | |
download | wireguard-openbsd-209ccf4d11ca3e62124dc6964029fcc729c0711f.tar.xz wireguard-openbsd-209ccf4d11ca3e62124dc6964029fcc729c0711f.zip |
Avoid using DEV_BSHIFT, and use DEV_BSIZE instead.
-rw-r--r-- | sys/arch/amd64/stand/libsa/biosdev.c | 6 | ||||
-rw-r--r-- | sys/arch/hp300/stand/common/scsi.c | 10 | ||||
-rw-r--r-- | sys/arch/hppa/stand/libsa/pdc.c | 6 | ||||
-rw-r--r-- | sys/arch/hppa64/stand/libsa/pdc.c | 6 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/biosdev.c | 6 |
5 files changed, 17 insertions, 17 deletions
diff --git a/sys/arch/amd64/stand/libsa/biosdev.c b/sys/arch/amd64/stand/libsa/biosdev.c index d15cb0bafef..319d9a3bec6 100644 --- a/sys/arch/amd64/stand/libsa/biosdev.c +++ b/sys/arch/amd64/stand/libsa/biosdev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: biosdev.c,v 1.19 2012/10/27 15:43:42 jsing Exp $ */ +/* $OpenBSD: biosdev.c,v 1.20 2013/03/23 16:08:27 deraadt Exp $ */ /* * Copyright (c) 1996 Michael Shalayeff @@ -257,8 +257,8 @@ biosd_io(int rw, bios_diskinfo_t *bd, u_int off, int nsect, void *buf) * routine. However, the El Torito spec says that the * BIOS will work in 2,048-byte sectors. So shift back. */ - off >>= (ISO_DEFAULT_BLOCK_SHIFT - DEV_BSHIFT); - nsect >>= (ISO_DEFAULT_BLOCK_SHIFT - DEV_BSHIFT); + off /= (ISO_DEFAULT_BLOCK_SIZE / DEV_BSIZE); + nsect /= (ISO_DEFAULT_BLOCK_SIZE / DEV_BSIZE); } /* diff --git a/sys/arch/hp300/stand/common/scsi.c b/sys/arch/hp300/stand/common/scsi.c index fb5321dd0d3..42bd5cc1ff8 100644 --- a/sys/arch/hp300/stand/common/scsi.c +++ b/sys/arch/hp300/stand/common/scsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsi.c,v 1.8 2011/08/18 20:02:58 miod Exp $ */ +/* $OpenBSD: scsi.c,v 1.9 2013/03/23 16:08:28 deraadt Exp $ */ /* $NetBSD: scsi.c,v 1.7 1997/01/30 10:32:57 thorpej Exp $ */ /* @@ -403,8 +403,8 @@ scsi_tt_read(int ctlr, int slave, u_char *buf, u_int len, daddr32_t blk, cdb.lbahm = blk >> 16; cdb.lbalm = blk >> 8; cdb.lbal = blk; - cdb.lenh = nblk >> (8 + DEV_BSHIFT); - cdb.lenl = nblk >> DEV_BSHIFT; + cdb.lenh = nblk / (256 * DEV_BSIZE); + cdb.lenl = nblk / DEV_BSIZE; return (scsiicmd(hs, slave, (u_char *)&cdb, sizeof(cdb), buf, len, DATA_IN_PHASE)); } @@ -422,8 +422,8 @@ scsi_tt_write(int ctlr, int slave, u_char *buf, u_int len, daddr32_t blk, cdb.lbahm = blk >> 16; cdb.lbalm = blk >> 8; cdb.lbal = blk; - cdb.lenh = nblk >> (8 + DEV_BSHIFT); - cdb.lenl = nblk >> DEV_BSHIFT; + cdb.lenh = nblk / (256 * DEV_BSIZE); + cdb.lenl = nblk / DEV_BSIZE; return (scsiicmd(hs, slave, (u_char *)&cdb, sizeof(cdb), buf, len, DATA_OUT_PHASE)); } diff --git a/sys/arch/hppa/stand/libsa/pdc.c b/sys/arch/hppa/stand/libsa/pdc.c index a91f619baef..7ab9abbbd4e 100644 --- a/sys/arch/hppa/stand/libsa/pdc.c +++ b/sys/arch/hppa/stand/libsa/pdc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pdc.c,v 1.20 2011/03/13 00:13:52 deraadt Exp $ */ +/* $OpenBSD: pdc.c,v 1.21 2013/03/23 16:08:28 deraadt Exp $ */ /* * Copyright (c) 1998-2004 Michael Shalayeff @@ -59,6 +59,7 @@ * Utah $Hdr: pdc.c 1.8 92/03/14$ */ +#include <sys/param.h> #include <sys/time.h> #include "libsa.h" #include <sys/reboot.h> @@ -68,7 +69,6 @@ #include <machine/pdc.h> #include <machine/iomod.h> #include <machine/nvm.h> -#include <machine/param.h> #include <machine/cpufunc.h> #include "dev_hppa.h" @@ -147,7 +147,7 @@ iodcstrategy(devdata, rw, blk, size, buf, rsize) #endif blk += dp->fsoff; - blk <<= DEV_BSHIFT; + blk *= DEV_BSIZE; if ((pzdev->pz_class & PCL_CLASS_MASK) == PCL_SEQU) { /* rewind and re-read to seek */ if (blk < dp->last_blk) { diff --git a/sys/arch/hppa64/stand/libsa/pdc.c b/sys/arch/hppa64/stand/libsa/pdc.c index 5ff24400bb8..252a0bd72bf 100644 --- a/sys/arch/hppa64/stand/libsa/pdc.c +++ b/sys/arch/hppa64/stand/libsa/pdc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pdc.c,v 1.2 2011/03/13 00:13:52 deraadt Exp $ */ +/* $OpenBSD: pdc.c,v 1.3 2013/03/23 16:08:28 deraadt Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -50,6 +50,7 @@ * Utah $Hdr: pdc.c 1.8 92/03/14$ */ +#include <sys/param.h> #include <sys/time.h> #include "libsa.h" #include <sys/reboot.h> @@ -59,7 +60,6 @@ #include <machine/pdc.h> #include <machine/iomod.h> #include <machine/nvm.h> -#include <machine/param.h> #include <machine/cpufunc.h> #include "dev_hppa64.h" @@ -139,7 +139,7 @@ iodcstrategy(devdata, rw, blk, size, buf, rsize) #endif blk += dp->fsoff; - blk <<= DEV_BSHIFT; + blk *= DEV_BSIZE; if ((pzdev->pz_class & PCL_CLASS_MASK) == PCL_SEQU) { /* rewind and re-read to seek */ if (blk < dp->last_blk) { diff --git a/sys/arch/i386/stand/libsa/biosdev.c b/sys/arch/i386/stand/libsa/biosdev.c index 3d1e1aba85f..2967e7ea162 100644 --- a/sys/arch/i386/stand/libsa/biosdev.c +++ b/sys/arch/i386/stand/libsa/biosdev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: biosdev.c,v 1.86 2012/11/01 00:55:38 jsing Exp $ */ +/* $OpenBSD: biosdev.c,v 1.87 2013/03/23 16:08:29 deraadt Exp $ */ /* * Copyright (c) 1996 Michael Shalayeff @@ -258,8 +258,8 @@ biosd_io(int rw, bios_diskinfo_t *bd, u_int off, int nsect, void *buf) * routine. However, the El Torito spec says that the * BIOS will work in 2,048-byte sectors. So shift back. */ - off >>= (ISO_DEFAULT_BLOCK_SHIFT - DEV_BSHIFT); - nsect >>= (ISO_DEFAULT_BLOCK_SHIFT - DEV_BSHIFT); + off /= (ISO_DEFAULT_BLOCK_SIZE / DEV_BSIZE); + nsect /= (ISO_DEFAULT_BLOCK_SIZE / DEV_BSIZE); } /* |