From dedefa34dee3dc7af0f71ec8a381e049524b0d13 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 14 Aug 2009 18:53:10 +0000 Subject: [PATCH] Rearranged preprocessor statements containing version checks such that these are now processed correctly by scripts/specialize-patch. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1048 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_lib.c | 8 ++++---- scst/src/scst_main.c | 10 ++++------ scst/src/scst_proc.c | 6 ++++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index e15a15f9a..6ed5d2b90 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -1247,8 +1247,8 @@ int scst_alloc_device(gfp_t gfp_mask, struct scst_device **out_dev) dev->queue_alg = SCST_CONTR_MODE_QUEUE_ALG_UNRESTRICTED_REORDER; dev->dev_num = dev_num++; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) -#if defined(CONFIG_BLOCK) && defined(SCST_IO_CONTEXT) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) && defined(SCST_IO_CONTEXT) +#if defined(CONFIG_BLOCK) dev->dev_io_ctx = alloc_io_context(GFP_KERNEL, -1); if (dev->dev_io_ctx == NULL) { TRACE(TRACE_OUT_OF_MEM, "%s", "Failed to alloc dev IO context"); @@ -1553,8 +1553,8 @@ static struct scst_tgt_dev *scst_alloc_add_tgt_dev(struct scst_session *sess, tgt_dev->sess->initiator_name); tgt_dev->tgt_dev_io_ctx = ioc_task_link(t->tgt_dev_io_ctx); } else { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) -#if defined(CONFIG_BLOCK) && defined(SCST_IO_CONTEXT) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) && defined(SCST_IO_CONTEXT) +#if defined(CONFIG_BLOCK) tgt_dev->tgt_dev_io_ctx = alloc_io_context(GFP_KERNEL, -1); if (tgt_dev->tgt_dev_io_ctx == NULL) { TRACE(TRACE_OUT_OF_MEM, "Failed to alloc tgt_dev IO " diff --git a/scst/src/scst_main.c b/scst/src/scst_main.c index 4a56cb8a4..af1272a4a 100644 --- a/scst/src/scst_main.c +++ b/scst/src/scst_main.c @@ -40,9 +40,8 @@ details." #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) -#if !defined(SCSI_EXEC_REQ_FIFO_DEFINED) && \ - !defined(CONFIG_SCST_STRICT_SERIALIZING) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) && !defined(SCSI_EXEC_REQ_FIFO_DEFINED) +#if !defined(CONFIG_SCST_STRICT_SERIALIZING) #warning "Patch scst_exec_req_fifo- was not applied on\ your kernel and CONFIG_SCST_STRICT_SERIALIZING isn't defined.\ Pass-through dev handlers will not work." @@ -915,9 +914,8 @@ int __scst_register_dev_driver(struct scst_dev_type *dev_type, if (res != 0) goto out_error; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) -#if !defined(SCSI_EXEC_REQ_FIFO_DEFINED) && \ - !defined(CONFIG_SCST_STRICT_SERIALIZING) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) && !defined(SCSI_EXEC_REQ_FIFO_DEFINED) +#if !defined(CONFIG_SCST_STRICT_SERIALIZING) if (dev_type->exec == NULL) { PRINT_ERROR("Pass-through dev handlers (handler \"%s\") not " "supported. Consider applying on your kernel patch " diff --git a/scst/src/scst_proc.c b/scst/src/scst_proc.c index f6fe400b1..327f3dbe6 100644 --- a/scst/src/scst_proc.c +++ b/scst/src/scst_proc.c @@ -185,7 +185,8 @@ static DEFINE_MUTEX(scst_proc_mutex); #include -#if !defined(CONFIG_PPC) && (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22)) && (!defined(RHEL_RELEASE_CODE) || RHEL_RELEASE_CODE -0 < 5 * 256 + 3) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22)) && (!defined(RHEL_RELEASE_CODE) || RHEL_RELEASE_CODE -0 < 5 * 256 + 3) +#if !defined(CONFIG_PPC) /* * If strcasecmp() and strncasecmp() have already been declared in * , do not redefine these functions. Declarations for these @@ -232,7 +233,8 @@ static int strncasecmp(const char *s1, const char *s2, size_t n) return c1 - c2; } -#endif /* !CONFIG_PPC && (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22)) */ +#endif /* !CONFIG_PPC */ +#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22)) && (!defined(RHEL_RELEASE_CODE) || RHEL_RELEASE_CODE -0 < 5 * 256 + 3) */ #if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)