summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorYang Guang <yang.guang5@zte.com.cn>2022-01-14 14:03:16 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2022-01-15 16:30:24 +0200
commit6c4420b09267050bc47b3999d80457a8dabaeb89 (patch)
tree5ca99c638e5145ddeecdd66c6c08dcb83e511fe1 /arch
parentf2fed022aa0a1bce86ca02e16f6c5832711e6424 (diff)
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')
-rw-r--r--arch/ia64/kernel/setup.c5
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]);
}
}
}