]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
scsi: pmcraid: fix endianess sparse annotations
authorArnd Bergmann <arnd@arndb.de>
Thu, 20 Apr 2017 17:54:47 +0000 (19:54 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 24 Apr 2017 22:11:22 +0000 (18:11 -0400)
commit45c80be614b094459f2c699353080e4f8059f610
treecc52934c849b8d91c478c21108b20cbc9aca3973
parent3397623b370494fd7e0bca62b7578051482d058d
scsi: pmcraid: fix endianess sparse annotations

The use of le32_to_cpu() etc in this driver looks completely arbitrary.
It may have made sense at some point, but it is not applied consistently,
so this driver presumably won't work on big-endian kernel builds.

Unfortunately it's unclear whether the type names or the calls to
le32_to_cpu() are the correct ones. I'm taking educated guesses here
and assume that most of the __le32 and __le16 annotations are correct,
adding the conversion helpers whereever we access those fields.

The exceptions are the 'fw_version' field that is always accessed as
big-endian, so I'm changing the type here, and the 'hrrq' values that
are accessed as little-endian, so I'm changing those the other way.

None of these changes should have any effect on little-endian
architectures like x86, but it addresses the sparse warnings.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/pmcraid.c
drivers/scsi/pmcraid.h