ata_tf_read_block() question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have a question on CHS calculation in ata_tf_read_block().

The calculation in ata_tf_read_block() is:
	block = (cyl * dev->heads + head) * dev->sectors + sect;

but ata_build_rw_tf() does:
	track = (u32)block / dev->sectors;
	cyl   = track / dev->heads;
	head  = track % dev->heads;
	sect  = (u32)block % dev->sectors + 1;

It seems inconsistent.  The correct calculation is:
	block = (cyl * dev->heads + head) * dev->sectors + sect - 1;
isn't it?

I don't have any real problem.  Just noticed by code reading.
---
Atsushi Nemoto
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux