diff options
author | Arnd Bergmann <arnd@arndb.de> | 2017-04-20 19:54:47 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-04-24 18:11:22 -0400 |
commit | 45c80be614b094459f2c699353080e4f8059f610 (patch) | |
tree | cc52934c849b8d91c478c21108b20cbc9aca3973 /drivers/scsi/pmcraid.h | |
parent | 3397623b370494fd7e0bca62b7578051482d058d (diff) | |
download | linux-stable-45c80be614b094459f2c699353080e4f8059f610.tar.gz linux-stable-45c80be614b094459f2c699353080e4f8059f610.tar.bz2 linux-stable-45c80be614b094459f2c699353080e4f8059f610.zip |
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>
Diffstat (limited to 'drivers/scsi/pmcraid.h')
-rw-r--r-- | drivers/scsi/pmcraid.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/scsi/pmcraid.h b/drivers/scsi/pmcraid.h index 568b18a2f47d..01eb2bc16dc1 100644 --- a/drivers/scsi/pmcraid.h +++ b/drivers/scsi/pmcraid.h @@ -554,7 +554,7 @@ struct pmcraid_inquiry_data { __u8 add_page_len; __u8 length; __u8 reserved2; - __le16 fw_version; + __be16 fw_version; __u8 reserved3[16]; }; @@ -697,13 +697,13 @@ struct pmcraid_instance { dma_addr_t hrrq_start_bus_addr[PMCRAID_NUM_MSIX_VECTORS]; /* Pointer to 1st entry of HRRQ */ - __be32 *hrrq_start[PMCRAID_NUM_MSIX_VECTORS]; + __le32 *hrrq_start[PMCRAID_NUM_MSIX_VECTORS]; /* Pointer to last entry of HRRQ */ - __be32 *hrrq_end[PMCRAID_NUM_MSIX_VECTORS]; + __le32 *hrrq_end[PMCRAID_NUM_MSIX_VECTORS]; /* Pointer to current pointer of hrrq */ - __be32 *hrrq_curr[PMCRAID_NUM_MSIX_VECTORS]; + __le32 *hrrq_curr[PMCRAID_NUM_MSIX_VECTORS]; /* Lock for HRRQ access */ spinlock_t hrrq_lock[PMCRAID_NUM_MSIX_VECTORS]; |