- Fixed a checkpatch complaint.
authorbvassche <bvassche@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Mon, 7 Dec 2009 08:07:58 +0000 (08:07 +0000)
committerbvassche <bvassche@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Mon, 7 Dec 2009 08:07:58 +0000 (08:07 +0000)
- Made sure that the SRPT source code compiles again on systems with a 2.6.29
  or older kernel.

git-svn-id: https://scst.svn.sourceforge.net/svnroot/scst/trunk@1382 d57e44dd-8a1f-0410-8b47-8ef2f437770f

srpt/src/ib_srpt.c

index 0e25eff..28fd554 100644 (file)
@@ -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 {