Commit 59abc8cc authored by Bart Van Assche's avatar Bart Van Assche Committed by Martin K. Petersen

scsi: libsas: Remove scsi_to_u32()

Since the function scsi_to_u32() is identical to get_unaligned_be32(),
change all scsi_to_u32() calls into get_unaligned_be32() calls.

Cc: Jian Luo <luojian5@huawei.com>
Cc: John Garry <john.garry@huawei.com>
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Reviewed-by: default avatarJohn Garry <john.garry@huawei.com>
Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent b64ae4ab
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <linux/scatterlist.h> #include <linux/scatterlist.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <asm/unaligned.h>
#include "sas_internal.h" #include "sas_internal.h"
...@@ -696,10 +697,10 @@ int sas_smp_get_phy_events(struct sas_phy *phy) ...@@ -696,10 +697,10 @@ int sas_smp_get_phy_events(struct sas_phy *phy)
if (res) if (res)
goto out; goto out;
phy->invalid_dword_count = scsi_to_u32(&resp[12]); phy->invalid_dword_count = get_unaligned_be32(&resp[12]);
phy->running_disparity_error_count = scsi_to_u32(&resp[16]); phy->running_disparity_error_count = get_unaligned_be32(&resp[16]);
phy->loss_of_dword_sync_count = scsi_to_u32(&resp[20]); phy->loss_of_dword_sync_count = get_unaligned_be32(&resp[20]);
phy->phy_reset_problem_count = scsi_to_u32(&resp[24]); phy->phy_reset_problem_count = get_unaligned_be32(&resp[24]);
out: out:
kfree(req); kfree(req);
......
...@@ -274,10 +274,4 @@ static inline int scsi_is_wlun(u64 lun) ...@@ -274,10 +274,4 @@ static inline int scsi_is_wlun(u64 lun)
/* Used to obtain the PCI location of a device */ /* Used to obtain the PCI location of a device */
#define SCSI_IOCTL_GET_PCI 0x5387 #define SCSI_IOCTL_GET_PCI 0x5387
/* Pull a u32 out of a SCSI message (using BE SCSI conventions) */
static inline __u32 scsi_to_u32(__u8 *ptr)
{
return (ptr[0]<<24) + (ptr[1]<<16) + (ptr[2]<<8) + ptr[3];
}
#endif /* _SCSI_SCSI_H */ #endif /* _SCSI_SCSI_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment