提交 91f68b73 编写于 作者: W Wu Fengguang 提交者: Linus Torvalds

generic swap(): introduce global macro swap(a, b)

There have been some local definitions of swap(), it's time to replace
them all with a uniform one.
Signed-off-by: NWu Fengguang <fengguang.wu@intel.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 b53907c0
......@@ -476,6 +476,12 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
__val = __val < __min ? __min: __val; \
__val > __max ? __max: __val; })
/*
* swap - swap value of @a and @b
*/
#define swap(a, b) ({ typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; })
/**
* container_of - cast a member of a structure out to the containing structure
* @ptr: the pointer to the member.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册