From e4b93a83c0823bbda7faf7dd0fe4023c9e74c893 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 7 Dec 2009 08:07:58 +0000 Subject: [PATCH] - Fixed a checkpatch complaint. - Made sure that the SRPT source code compiles again on systems with a 2.6.29 or older kernel. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1382 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index 0e25eff64..28fd554c2 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -817,8 +817,12 @@ static int srpt_get_desc_tbl(struct srpt_ioctx *ioctx, struct srp_cmd *srp_cmd) * The pointer computations below will only be compiled correctly * if srp_cmd::add_data is declared as s8*, u8*, s8[] or u8[]. */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30) BUILD_BUG_ON(!__same_type(srp_cmd->add_data[0], (s8)0) && !__same_type(srp_cmd->add_data[0], (u8)0)); +#else + /* Note: the __same_type() macro has been introduced in kernel 2.6.30.*/ +#endif ret = 0; /* @@ -832,8 +836,8 @@ static int srpt_get_desc_tbl(struct srpt_ioctx *ioctx, struct srp_cmd *srp_cmd) ioctx->n_rbuf = 1; ioctx->rbufs = &ioctx->single_rbuf; - db = (struct srp_direct_buf*)(srp_cmd->add_data - + add_cdb_offset); + db = (struct srp_direct_buf *)(srp_cmd->add_data + + add_cdb_offset); memcpy(ioctx->rbufs, db, sizeof *db); ioctx->data_len = be32_to_cpu(db->len); } else {