]> git.baikalelectronics.ru Git - kernel.git/commit
mpt2sas: Avoid type casting for direct I/O commands
authorSreekanth Reddy <sreekanth.reddy@avagotech.com>
Fri, 12 Sep 2014 10:05:21 +0000 (15:35 +0530)
committerChristoph Hellwig <hch@lst.de>
Tue, 16 Sep 2014 16:14:15 +0000 (09:14 -0700)
commit0bdf0d37be3333c21198acd928f1b278aa3f3b05
tree712a7a2df69c28e69b9e0308e54c3836deb8fbe3
parent62f2580a8ceaa9d657f6cfe8f160cb1bca329ef6
mpt2sas: Avoid type casting for direct I/O commands

A type casting error caused the max volume LBA to be truncated from 64
to 32 bits. The virtual LBA would also get truncated to 32 bits in the
case of a 16-byte READ/WRITE command.

Rewrite entire function to get rid of code duplication and type casts.
Use get/put_unaligned wrappers to extract and replace the LBA field in
the MPI request CDB.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Tested-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/scsi/mpt2sas/mpt2sas_scsih.c