libata: fix ata_id_logical_per_physical_sectors
authorChristoph Hellwig <hch@lst.de>
Thu, 28 Jan 2010 12:30:11 +0000 (13:30 +0100)
committerJeff Garzik <jgarzik@redhat.com>
Thu, 4 Feb 2010 06:01:32 +0000 (01:01 -0500)
commitf7acede65d6b65919aee5b6a360a17cedb11f2f7
treeac1adbda9b14e2820e8bee2407bf6895c357d9b0
parentbc496ed00ab1411d3efaf295b72e0c9eb343e1a3
libata: fix ata_id_logical_per_physical_sectors

The value we get from the low byte of the ATA_ID_SECTOR_SIZE word is not not
a plain multiple, but the log of it, so fix the helper to give the correct
answer.  Without this we'll get an incorrect minimal I/O size in the block
limits VPD page for 4k sector drives.

Also change the return value of ata_id_logical_per_physical_sectors to u16
for the unlikely case of very large logical sectors.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
include/linux/ata.h