diff options
| author | Pedro F. Giffuni <pfg@FreeBSD.org> | 2016-04-26 15:03:15 +0000 |
|---|---|---|
| committer | Pedro F. Giffuni <pfg@FreeBSD.org> | 2016-04-26 15:03:15 +0000 |
| commit | 057b4402bf634907fd03590e2757e09e975d04c7 (patch) | |
| tree | df1bb710ebf946f1a7c1b38464ef836fddfee71c /sys/dev/mfi | |
| parent | 768f89e0788ab1ab7ea5df9d57082f53567007ec (diff) | |
Notes
Diffstat (limited to 'sys/dev/mfi')
| -rw-r--r-- | sys/dev/mfi/mfi.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/mfi/mfi.c b/sys/dev/mfi/mfi.c index c224186045aa..05751ba6dfa0 100644 --- a/sys/dev/mfi/mfi.c +++ b/sys/dev/mfi/mfi.c @@ -2156,7 +2156,7 @@ mfi_build_syspdio(struct mfi_softc *sc, struct bio *bio) } /* Cheat with the sector length to avoid a non-constant division */ - blkcount = (bio->bio_bcount + MFI_SECTOR_LEN - 1) / MFI_SECTOR_LEN; + blkcount = howmany(bio->bio_bcount, MFI_SECTOR_LEN); /* Fill the LBA and Transfer length in CDB */ cdb_len = mfi_build_cdb(readop, 0, bio->bio_pblkno, blkcount, pass->cdb); @@ -2215,7 +2215,7 @@ mfi_build_ldio(struct mfi_softc *sc, struct bio *bio) } /* Cheat with the sector length to avoid a non-constant division */ - blkcount = (bio->bio_bcount + MFI_SECTOR_LEN - 1) / MFI_SECTOR_LEN; + blkcount = howmany(bio->bio_bcount, MFI_SECTOR_LEN); io->header.target_id = (uintptr_t)bio->bio_driver1; io->header.timeout = 0; io->header.flags = 0; @@ -2622,7 +2622,7 @@ mfi_dump_blocks(struct mfi_softc *sc, int id, uint64_t lba, void *virt, io->header.flags = 0; io->header.scsi_status = 0; io->header.sense_len = MFI_SENSE_LEN; - io->header.data_len = (len + MFI_SECTOR_LEN - 1) / MFI_SECTOR_LEN; + io->header.data_len = howmany(len, MFI_SECTOR_LEN); io->sense_addr_lo = (uint32_t)cm->cm_sense_busaddr; io->sense_addr_hi = (uint32_t)((uint64_t)cm->cm_sense_busaddr >> 32); io->lba_hi = (lba & 0xffffffff00000000) >> 32; @@ -2660,7 +2660,7 @@ mfi_dump_syspd_blocks(struct mfi_softc *sc, int id, uint64_t lba, void *virt, pass->header.cmd = MFI_CMD_PD_SCSI_IO; readop = 0; - blkcount = (len + MFI_SECTOR_LEN - 1) / MFI_SECTOR_LEN; + blkcount = howmany(len, MFI_SECTOR_LEN); cdb_len = mfi_build_cdb(readop, 0, lba, blkcount, pass->cdb); pass->header.target_id = id; pass->header.timeout = 0; |
