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 {