]> git.baikalelectronics.ru Git - kernel.git/commit
sata_promise: fix endianess bug in ASIC PRD bug workaround
authorMikael Pettersson <mikpe@it.uu.se>
Wed, 31 Oct 2007 12:21:29 +0000 (13:21 +0100)
committerJeff Garzik <jeff@garzik.org>
Sat, 3 Nov 2007 12:46:54 +0000 (08:46 -0400)
commit39c51ba81a2942665cebaa458427568f9c928877
tree026e8d66365e7d632431e03dc6a3ed64782ed735
parent67c013ed1ba5b9e98d9db54a3b6353df5c22a25a
sata_promise: fix endianess bug in ASIC PRD bug workaround

The original workaround for the Promise ASIC PRD bug
contained an endianess bug which I failed to detect:
the adjustment of the last PRD entry's length field
applied host arithmetic to little-endian data, which
is incorrect on big-endian machines.

We have the length available in host-endian format, so
do the adjustment on host-endian data and then convert
and store it in the PRD entry's little-endian data field.

Thanks to an anonymous reviewer for detecting this bug.

Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/ata/sata_promise.c