diff options
author | Yang Guang <yang.guang5@zte.com.cn> | 2022-01-14 23:03:16 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2022-01-15 15:30:24 +0100 |
commit | 6c4420b09267050bc47b3999d80457a8dabaeb89 (patch) | |
tree | 5ca99c638e5145ddeecdd66c6c08dcb83e511fe1 /arch/ia64 | |
parent | ia64: module: use swap() to make code cleaner (diff) | |
download | linux-6c4420b09267050bc47b3999d80457a8dabaeb89.tar.xz linux-6c4420b09267050bc47b3999d80457a8dabaeb89.zip |
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.cn
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Yang Guang <yang.guang5@zte.com.cn>
Cc: David Yang <davidcomponentone@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/ia64')
-rw-r--r-- | arch/ia64/kernel/setup.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index 31fb84de2d21..5010348fa21b 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c @@ -208,10 +208,7 @@ sort_regions (struct rsvd_region *rsvd_region, int max) while (max--) { for (j = 0; j < max; ++j) { if (rsvd_region[j].start > rsvd_region[j+1].start) { - struct rsvd_region tmp; - tmp = rsvd_region[j]; - rsvd_region[j] = rsvd_region[j + 1]; - rsvd_region[j + 1] = tmp; + swap(rsvd_region[j], rsvd_region[j + 1]); } } } |