Commit 6c4420b0 authored by Yang Guang's avatar Yang Guang Committed by Linus Torvalds

arch/ia64/kernel/setup.c: use swap() to make code cleaner

Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid
opencoding it.

Link: https://lkml.kernel.org/r/20211104001908.695110-1-yang.guang5@zte.com.cnReported-by: default avatarZeal Robot <zealci@zte.com.cn>
Signed-off-by: default avatarYang Guang <yang.guang5@zte.com.cn>
Cc: David Yang <davidcomponentone@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f2fed022
...@@ -208,10 +208,7 @@ sort_regions (struct rsvd_region *rsvd_region, int max) ...@@ -208,10 +208,7 @@ sort_regions (struct rsvd_region *rsvd_region, int max)
while (max--) { while (max--) {
for (j = 0; j < max; ++j) { for (j = 0; j < max; ++j) {
if (rsvd_region[j].start > rsvd_region[j+1].start) { if (rsvd_region[j].start > rsvd_region[j+1].start) {
struct rsvd_region tmp; swap(rsvd_region[j], rsvd_region[j + 1]);
tmp = rsvd_region[j];
rsvd_region[j] = rsvd_region[j + 1];
rsvd_region[j + 1] = tmp;
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment