aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kernel.h
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2009-02-04 18:11:59 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-02-05 15:56:46 -0500
commitac7b9004909d03d67016368093e81d37cae72895 (patch)
tree089cd0432d3c93b14dbd9d0178bfe2fa19690fd1 /include/linux/kernel.h
parentc073b2db006ba9370be1eecc36a1be1d9ce31310 (diff)
generic swap(): don't return a value from swap()
The swap() macro is accidentally retuning the value of its first argument. Change it into a doesn't-return-anything macro before someone goes and relies upon this behaviour. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Wu Fengguang <wfg@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r--include/linux/kernel.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 343df9ef2412..7fa371898e3e 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -480,7 +480,8 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
480/* 480/*
481 * swap - swap value of @a and @b 481 * swap - swap value of @a and @b
482 */ 482 */
483#define swap(a, b) ({ typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; }) 483#define swap(a, b) \
484 do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0)
484 485
485/** 486/**
486 * container_of - cast a member of a structure out to the containing structure 487 * container_of - cast a member of a structure out to the containing structure