From 89d4b044c3c377921d5605496fc127b3b00e5da0 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 7 Apr 2011 18:42:45 +0000 Subject: [PATCH] 2.6.38 build fixes (merged r3294 from trunk). git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.0.0.x@3364 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/iscsi.c | 4 ++-- iscsi-scst/kernel/iscsi.h | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/iscsi-scst/kernel/iscsi.c b/iscsi-scst/kernel/iscsi.c index 89853b42a..e54a0199c 100644 --- a/iscsi-scst/kernel/iscsi.c +++ b/iscsi-scst/kernel/iscsi.c @@ -1263,7 +1263,7 @@ static struct iscsi_cmnd *__cmnd_find_data_wait_hash(struct iscsi_conn *conn, struct list_head *head; struct iscsi_cmnd *cmnd; - head = &conn->session->cmnd_data_wait_hash[cmnd_hashfn(itt)]; + head = &conn->session->cmnd_data_wait_hash[cmnd_hashfn((__force u32)itt)]; list_for_each_entry(cmnd, head, hash_list_entry) { if (cmnd->pdu.bhs.itt == itt) @@ -1336,7 +1336,7 @@ static int cmnd_insert_data_wait_hash(struct iscsi_cmnd *cmnd) spin_lock(&session->cmnd_data_wait_hash_lock); - head = &session->cmnd_data_wait_hash[cmnd_hashfn(itt)]; + head = &session->cmnd_data_wait_hash[cmnd_hashfn((__force u32)itt)]; tmp = __cmnd_find_data_wait_hash(cmnd->conn, itt); if (likely(!tmp)) { diff --git a/iscsi-scst/kernel/iscsi.h b/iscsi-scst/kernel/iscsi.h index e3b51f401..6b48be4f2 100644 --- a/iscsi-scst/kernel/iscsi.h +++ b/iscsi-scst/kernel/iscsi.h @@ -103,12 +103,10 @@ struct iscsi_target { }; #define ISCSI_HASH_ORDER 8 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31) -#define cmnd_hashfn(itt) (BUILD_BUG_ON(!__same_type(itt, __be32)), \ - hash_long((__force u32)(itt), ISCSI_HASH_ORDER)) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) +#define cmnd_hashfn(itt) hash_32(itt, ISCSI_HASH_ORDER) #else -/* __same_type() is not available in kernels 2.6.30 and before. */ -#define cmnd_hashfn(itt) hash_long((__force u32)(itt), ISCSI_HASH_ORDER) +#define cmnd_hashfn(itt) hash_long(itt, ISCSI_HASH_ORDER) #endif struct iscsi_session {