From 5da3fc1f1b57619717bc32f0e0d246da766257a9 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 23 Jul 2010 07:24:27 +0000 Subject: [PATCH] Rewrote four #if statements such that these can be parsed by scripts/generate-kernel-patch. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1865 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/config.c | 10 ++++++---- scst/src/scst_sysfs.c | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/iscsi-scst/kernel/config.c b/iscsi-scst/kernel/config.c index 21815b09d..2d0da6dec 100644 --- a/iscsi-scst/kernel/config.c +++ b/iscsi-scst/kernel/config.c @@ -703,9 +703,10 @@ int iscsi_add_attr(struct iscsi_target *target, struct iscsi_attr *tgt_attr; struct list_head *attrs_list; const char *name; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) && \ - defined(CONFIG_DEBUG_LOCK_ALLOC)) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) +#ifdef CONFIG_DEBUG_LOCK_ALLOC static struct lock_class_key __key; +#endif #endif TRACE_ENTRY(); @@ -753,9 +754,10 @@ int iscsi_add_attr(struct iscsi_target *target, tgt_attr->attr.attr.name = tgt_attr->name; tgt_attr->attr.attr.owner = THIS_MODULE; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) && \ - defined(CONFIG_DEBUG_LOCK_ALLOC)) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) +#ifdef CONFIG_DEBUG_LOCK_ALLOC tgt_attr->attr.attr.key = &__key; +#endif #endif tgt_attr->attr.attr.mode = attr_info->mode & (S_IRUGO | S_IWUGO); tgt_attr->attr.show = iscsi_attr_show; diff --git a/scst/src/scst_sysfs.c b/scst/src/scst_sysfs.c index 2cbf3cc36..2f76abd9d 100644 --- a/scst/src/scst_sysfs.c +++ b/scst/src/scst_sysfs.c @@ -2530,9 +2530,10 @@ int scst_create_acn_sysfs(struct scst_acg *acg, struct scst_acn *acn) int retval = 0; int len; struct kobj_attribute *attr = NULL; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) && \ - defined(CONFIG_DEBUG_LOCK_ALLOC)) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) +#ifdef CONFIG_DEBUG_LOCK_ALLOC static struct lock_class_key __key; +#endif #endif TRACE_ENTRY(); @@ -2558,9 +2559,10 @@ int scst_create_acn_sysfs(struct scst_acg *acg, struct scst_acn *acn) strlcpy((char *)attr->attr.name, acn->name, len); attr->attr.owner = THIS_MODULE; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) && \ - defined(CONFIG_DEBUG_LOCK_ALLOC)) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) +#ifdef CONFIG_DEBUG_LOCK_ALLOC attr->attr.key = &__key; +#endif #endif attr->attr.mode = S_IRUGO;