public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 13/17] scsi: remove private implementation of get_unaligned_be32
@ 2008-10-29 21:24 akpm
  2008-10-29 21:48 ` James Bottomley
  0 siblings, 1 reply; 7+ messages in thread
From: akpm @ 2008-10-29 21:24 UTC (permalink / raw)
  To: James.Bottomley; +Cc: linux-scsi, akpm, harvey.harrison

From: Harvey Harrison <harvey.harrison@gmail.com>

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/scsi/libsas/sas_expander.c |    9 +++++----
 include/scsi/scsi.h                |    6 ------
 2 files changed, 5 insertions(+), 10 deletions(-)

diff -puN drivers/scsi/libsas/sas_expander.c~scsi-remove-private-implementation-of-get_unaligned_be32 drivers/scsi/libsas/sas_expander.c
--- a/drivers/scsi/libsas/sas_expander.c~scsi-remove-private-implementation-of-get_unaligned_be32
+++ a/drivers/scsi/libsas/sas_expander.c
@@ -24,6 +24,7 @@
 
 #include <linux/scatterlist.h>
 #include <linux/blkdev.h>
+#include <asm/unaligned.h>
 
 #include "sas_internal.h"
 
@@ -541,10 +542,10 @@ int sas_smp_get_phy_events(struct sas_ph
 	if (!res)
 		goto out;
 
-	phy->invalid_dword_count = scsi_to_u32(&resp[12]);
-	phy->running_disparity_error_count = scsi_to_u32(&resp[16]);
-	phy->loss_of_dword_sync_count = scsi_to_u32(&resp[20]);
-	phy->phy_reset_problem_count = scsi_to_u32(&resp[24]);
+	phy->invalid_dword_count = get_unaligned_be32(&resp[12]);
+	phy->running_disparity_error_count = get_unaligned_be32(&resp[16]);
+	phy->loss_of_dword_sync_count = get_unaligned_be32(&resp[20]);
+	phy->phy_reset_problem_count = get_unaligned_be32(&resp[24]);
 
  out:
 	kfree(resp);
diff -puN include/scsi/scsi.h~scsi-remove-private-implementation-of-get_unaligned_be32 include/scsi/scsi.h
--- a/include/scsi/scsi.h~scsi-remove-private-implementation-of-get_unaligned_be32
+++ a/include/scsi/scsi.h
@@ -527,10 +527,4 @@ static inline void set_driver_byte(struc
 /* Used to obtain the PCI location of a device */
 #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 */
_

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-10-30 14:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-29 21:24 [patch 13/17] scsi: remove private implementation of get_unaligned_be32 akpm
2008-10-29 21:48 ` James Bottomley
2008-10-29 22:07   ` Andrew Morton
2008-10-29 22:13     ` James Bottomley
2008-10-29 22:29       ` Harvey Harrison
2008-10-30  1:03         ` Harvey Harrison
2008-10-30 14:17           ` James Bottomley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox