From 7294df5dc4ace077177d8e2a63ea88df7a9dbf3a Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 12 Jun 2014 08:38:45 +0000 Subject: [PATCH] scst.h: Move definition of swap() Make sure that the definition of swap() is guarded by "#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)" only instead of "#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28)" and "#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)". git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5592 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/scst.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scst/include/scst.h b/scst/include/scst.h index ce827c371..3551760b0 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -127,13 +127,6 @@ char *kvasprintf(gfp_t gfp, const char *fmt, va_list ap); #define nr_cpumask_bits NR_CPUS #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) -#ifndef swap -#define swap(a, b) \ - do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0) -#endif -#endif - /* verify cpu argument to cpumask_* operators */ static inline unsigned int cpumask_check(unsigned int cpu) { @@ -187,6 +180,13 @@ static inline void cpumask_copy(cpumask_t *dstp, #define set_cpus_allowed_ptr(p, new_mask) set_cpus_allowed((p), *(new_mask)) #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) +#ifndef swap +#define swap(a, b) \ + do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0) +#endif +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31) static inline unsigned int queue_max_hw_sectors(struct request_queue *q) {