diff options
author | Matthew R. Ochs <mrochs@linux.vnet.ibm.com> | 2015-10-21 22:14:48 +0200 |
---|---|---|
committer | James Bottomley <JBottomley@Odin.com> | 2015-10-30 09:17:36 +0100 |
commit | 1786f4a0933198632c5e4d27f25e1d467e1fd032 (patch) | |
tree | 14789981147a57f9f24f79081b00317ca78e199a /drivers/scsi/cxlflash/common.h | |
parent | cxlflash: Fix function prolog parameters and return codes (diff) | |
download | linux-1786f4a0933198632c5e4d27f25e1d467e1fd032.tar.xz linux-1786f4a0933198632c5e4d27f25e1d467e1fd032.zip |
cxlflash: Fix MMIO and endianness errors
Sparse uncovered several errors with MMIO operations (accessing
directly) and handling endianness. These can cause issues when
running in different environments.
Introduce __iomem and proper endianness tags/swaps where
appropriate to make driver sparse clean.
Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Signed-off-by: Manoj N. Kumar <manoj@linux.vnet.ibm.com>
Reviewed-by: Brian King <brking@linux.vnet.ibm.com>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Diffstat (limited to 'drivers/scsi/cxlflash/common.h')
-rw-r--r-- | drivers/scsi/cxlflash/common.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/scsi/cxlflash/common.h b/drivers/scsi/cxlflash/common.h index 3be57549fe44..a81058555d97 100644 --- a/drivers/scsi/cxlflash/common.h +++ b/drivers/scsi/cxlflash/common.h @@ -164,9 +164,9 @@ struct afu { /* AFU HW */ struct cxl_ioctl_start_work work; - struct cxlflash_afu_map *afu_map; /* entire MMIO map */ - struct sisl_host_map *host_map; /* MC host map */ - struct sisl_ctrl_map *ctrl_map; /* MC control map */ + struct cxlflash_afu_map __iomem *afu_map; /* entire MMIO map */ + struct sisl_host_map __iomem *host_map; /* MC host map */ + struct sisl_ctrl_map __iomem *ctrl_map; /* MC control map */ ctx_hndl_t ctx_hndl; /* master's context handle */ u64 *hrrq_start; @@ -188,10 +188,10 @@ struct afu { static inline u64 lun_to_lunid(u64 lun) { - u64 lun_id; + __be64 lun_id; int_to_scsilun(lun, (struct scsi_lun *)&lun_id); - return swab64(lun_id); + return be64_to_cpu(lun_id); } int cxlflash_afu_sync(struct afu *, ctx_hndl_t, res_hndl_t, u8); |