[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211104061709.1505592-1-yang.guang5@zte.com.cn>
Date: Thu, 4 Nov 2021 14:17:09 +0800
From: davidcomponentone@...il.com
To: mpe@...erman.id.au
Cc: davidcomponentone@...il.com, benh@...nel.crashing.org,
paulus@...ba.org, nathan@...nel.org, sfr@...b.auug.org.au,
sxwjean@...il.com, aneesh.kumar@...ux.ibm.com,
yang.guang5@....com.cn, linuxppc-dev@...ts.ozlabs.org,
linux-kernel@...r.kernel.org, Zeal Robot <zealci@....com.cn>
Subject: [PATCH] powerpc: use swap() to make code cleaner
From: Yang Guang <yang.guang5@....com.cn>
Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid
opencoding it.
Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Yang Guang <yang.guang5@....com.cn>
---
arch/powerpc/kernel/fadump.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index b7ceb041743c..5b40e2d46090 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -1265,7 +1265,6 @@ static void fadump_release_reserved_area(u64 start, u64 end)
static void sort_and_merge_mem_ranges(struct fadump_mrange_info *mrange_info)
{
struct fadump_memory_range *mem_ranges;
- struct fadump_memory_range tmp_range;
u64 base, size;
int i, j, idx;
@@ -1281,9 +1280,7 @@ static void sort_and_merge_mem_ranges(struct fadump_mrange_info *mrange_info)
idx = j;
}
if (idx != i) {
- tmp_range = mem_ranges[idx];
- mem_ranges[idx] = mem_ranges[i];
- mem_ranges[i] = tmp_range;
+ swap(mem_ranges[idx], mem_ranges[i]);
}
}
--
2.30.2
Powered by blists - more mailing lists