[PATCH] ia64: use swap() to make code cleaner

From: davidcomponentone
Date: Wed Nov 03 2021 - 20:19:22 EST


From: Yang Guang <yang.guang5@xxxxxxxxxx>

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

Signed-off-by: Yang Guang <yang.guang5@xxxxxxxxxx>
Reported-by: Zeal Robot <zealci@xxxxxxxxxx>
---
arch/ia64/kernel/setup.c | 5 +----
1 file changed, 1 insertion(+), 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]);
}
}
}
--
2.30.2