From 385b8c7586d74a991ab2a57cf20c43eb19f8bf0b Mon Sep 17 00:00:00 2001 From: Halit Alptekin Date: Sun, 12 May 2013 15:33:11 +0300 Subject: [PATCH] swap value macro change with xor --- include/linux/kernel.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index e96329ceb28c84..34aa573361ffe6 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -767,11 +767,11 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { } /* - * swap - swap value of @a and @b + * swap - swap value of @a and @b using xor */ #define swap(a, b) \ - do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0) - + (((a) ^= (b)), ((b) ^= (a)), ((a) ^= (b))) + /** * container_of - cast a member of a structure out to the containing structure * @ptr: the pointer to the member.