Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: John Garry <john.garry@huawei.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Bart Van Assche and committed by
Martin K. Petersen
59abc8cc b64ae4ab

+5 -10
+5 -4
drivers/scsi/libsas/sas_expander.c
··· 25 25 #include <linux/scatterlist.h> 26 26 #include <linux/blkdev.h> 27 27 #include <linux/slab.h> 28 + #include <asm/unaligned.h> 28 29 29 30 #include "sas_internal.h" 30 31 ··· 697 696 if (res) 698 697 goto out; 699 698 700 - phy->invalid_dword_count = scsi_to_u32(&resp[12]); 701 - phy->running_disparity_error_count = scsi_to_u32(&resp[16]); 702 - phy->loss_of_dword_sync_count = scsi_to_u32(&resp[20]); 703 - phy->phy_reset_problem_count = scsi_to_u32(&resp[24]); 699 + phy->invalid_dword_count = get_unaligned_be32(&resp[12]); 700 + phy->running_disparity_error_count = get_unaligned_be32(&resp[16]); 701 + phy->loss_of_dword_sync_count = get_unaligned_be32(&resp[20]); 702 + phy->phy_reset_problem_count = get_unaligned_be32(&resp[24]); 704 703 705 704 out: 706 705 kfree(req);
-6
include/scsi/scsi.h
··· 274 274 /* Used to obtain the PCI location of a device */ 275 275 #define SCSI_IOCTL_GET_PCI 0x5387 276 276 277 - /* Pull a u32 out of a SCSI message (using BE SCSI conventions) */ 278 - static inline __u32 scsi_to_u32(__u8 *ptr) 279 - { 280 - return (ptr[0]<<24) + (ptr[1]<<16) + (ptr[2]<<8) + ptr[3]; 281 - } 282 - 283 277 #endif /* _SCSI_SCSI_H */