[SCSI] mpt2sas: Fix linux driver sparse errors
authornagalakshmi.nandigama@lsi.com <nagalakshmi.nandigama@lsi.com>
Tue, 20 Mar 2012 06:37:48 +0000 (12:07 +0530)
committerJames Bottomley <JBottomley@Parallels.com>
Mon, 23 Apr 2012 18:27:27 +0000 (19:27 +0100)
Fix several endian issues found by runing sparse.

Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/mpt2sas/mpt2sas_base.c
drivers/scsi/mpt2sas/mpt2sas_scsih.c

index f162db3a0c050051d17b2ef2d5e6985f7aa783a4..702faf67710a434a8e89c2e4c6f9a8648a8c83be 100644 (file)
@@ -4160,7 +4160,8 @@ _base_make_ioc_operational(struct MPT2SAS_ADAPTER *ioc, int sleep_flag)
        if (ioc->is_driver_loading) {
                if (ioc->is_warpdrive && ioc->manu_pg10.OEMIdentifier
                    == 0x80) {
-                       hide_flag = (u8) (ioc->manu_pg10.OEMSpecificFlags0 &
+                       hide_flag = (u8) (
+                           le32_to_cpu(ioc->manu_pg10.OEMSpecificFlags0) &
                            MFG_PAGE10_HIDE_SSDS_MASK);
                        if (hide_flag != MFG_PAGE10_HIDE_SSDS_MASK)
                                ioc->mfg_pg10_hide_flag = hide_flag;
index 9de474051507b1f68519a47f52ce573cc6cba084..d901d4bffeaa42faa1c2ea866653646828007171 100644 (file)
@@ -1854,7 +1854,8 @@ _scsih_init_warpdrive_properties(struct MPT2SAS_ADAPTER *ioc,
                if (mpt2sas_config_get_phys_disk_pg0(ioc, &mpi_reply,
                    &pd_pg0, MPI2_PHYSDISK_PGAD_FORM_PHYSDISKNUM,
                    vol_pg0->PhysDisk[count].PhysDiskNum) ||
-                   pd_pg0.DevHandle == MPT2SAS_INVALID_DEVICE_HANDLE) {
+                    le16_to_cpu(pd_pg0.DevHandle) ==
+                   MPT2SAS_INVALID_DEVICE_HANDLE) {
                        printk(MPT2SAS_INFO_FMT "WarpDrive : Direct IO is "
                            "disabled for the drive with handle(0x%04x) member"
                            "handle retrieval failed for member number=%d\n",
@@ -7411,14 +7412,14 @@ mpt2sas_scsih_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 msix_index,
        case MPI2_EVENT_LOG_ENTRY_ADDED:
        {
                Mpi2EventDataLogEntryAdded_t *log_entry;
-               u32 *log_code;
+               __le32 *log_code;
 
                if (!ioc->is_warpdrive)
                        break;
 
                log_entry = (Mpi2EventDataLogEntryAdded_t *)
                    mpi_reply->EventData;
-               log_code = (u32 *)log_entry->LogData;
+               log_code = (__le32 *)log_entry->LogData;
 
                if (le16_to_cpu(log_entry->LogEntryQualifier)
                    != MPT2_WARPDRIVE_LOGENTRY)