From 7b0e8251a38d162852d5177bc875b41ba6c8424e Mon Sep 17 00:00:00 2001 From: Aaron Campbell Date: Tue, 6 Jul 2004 00:38:39 +0000 Subject: Replace magic number with a more descriptive #define. This magic number was particularly vile because it looks like a typo (i.e., looks like one "f" is missing), but it's really not. I happened to notice this myself, but the fix is inspired by NetBSD in the interest of keeping the code similar. deraadt@ ok --- sys/dev/ata/wd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sys/dev/ata/wd.c') diff --git a/sys/dev/ata/wd.c b/sys/dev/ata/wd.c index 0cc70814c7a..97c52e29b0f 100644 --- a/sys/dev/ata/wd.c +++ b/sys/dev/ata/wd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wd.c,v 1.40 2004/03/03 17:16:03 tedu Exp $ */ +/* $OpenBSD: wd.c,v 1.41 2004/07/06 00:38:38 aaron Exp $ */ /* $NetBSD: wd.c,v 1.193 1999/02/28 17:15:27 explorer Exp $ */ /* @@ -104,6 +104,8 @@ #include "locators.h" #endif +#define LBA48_THRESHOLD (0xfffffff) /* 128GB / DEV_BSIZE */ + #define WDIORETRIES_SINGLE 4 /* number of retries before single-sector */ #define WDIORETRIES 5 /* number of retries before giving up */ #define RECOVERYTIME hz/2 /* time to wait before retrying a cmd */ @@ -561,7 +563,8 @@ __wdstart(struct wd_softc *wd, struct buf *bp) nblks = bp->b_bcount / wd->sc_dk.dk_label->d_secsize; if ((wd->sc_flags & WDF_LBA48) && /* use LBA48 only if really need */ - ((wd->sc_wdc_bio.blkno + nblks - 1 > 0xfffffff) || (nblks > 0xff))) + ((wd->sc_wdc_bio.blkno + nblks - 1 > LBA48_THRESHOLD) || + (nblks > 0xff))) wd->sc_wdc_bio.flags |= ATA_LBA48; if (wd->sc_flags & WDF_LBA) wd->sc_wdc_bio.flags |= ATA_LBA; -- cgit v1.2.3