]> git.baikalelectronics.ru Git - kernel.git/commitdiff
arch/ia64/kernel/setup.c: use swap() to make code cleaner
authorYang Guang <yang.guang5@zte.com.cn>
Fri, 14 Jan 2022 22:03:16 +0000 (14:03 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 15 Jan 2022 14:30:24 +0000 (16:30 +0200)
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>
arch/ia64/kernel/setup.c

index 31fb84de2d21469ae3319b8e3ebaf9b05543173a..5010348fa21be0aa33114221d4e834707f6b9eee 100644 (file)
@@ -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]);
                        }
                }
        }