powerpc/fadump: Use swap() instead of open coding it
Clean the following coccicheck warning: ./arch/powerpc/kernel/fadump.c:1291:34-35: WARNING opportunity for swap(). Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20220129034847.76902-1-jiapeng.chong@linux.alibaba.com
This commit is contained in:
parent
e9bb94cde1
commit
2077631917
@ -1285,7 +1285,6 @@ static void fadump_release_reserved_area(u64 start, u64 end)
|
|||||||
static void sort_and_merge_mem_ranges(struct fadump_mrange_info *mrange_info)
|
static void sort_and_merge_mem_ranges(struct fadump_mrange_info *mrange_info)
|
||||||
{
|
{
|
||||||
struct fadump_memory_range *mem_ranges;
|
struct fadump_memory_range *mem_ranges;
|
||||||
struct fadump_memory_range tmp_range;
|
|
||||||
u64 base, size;
|
u64 base, size;
|
||||||
int i, j, idx;
|
int i, j, idx;
|
||||||
|
|
||||||
@ -1300,11 +1299,8 @@ static void sort_and_merge_mem_ranges(struct fadump_mrange_info *mrange_info)
|
|||||||
if (mem_ranges[idx].base > mem_ranges[j].base)
|
if (mem_ranges[idx].base > mem_ranges[j].base)
|
||||||
idx = j;
|
idx = j;
|
||||||
}
|
}
|
||||||
if (idx != i) {
|
if (idx != i)
|
||||||
tmp_range = mem_ranges[idx];
|
swap(mem_ranges[idx], mem_ranges[i]);
|
||||||
mem_ranges[idx] = mem_ranges[i];
|
|
||||||
mem_ranges[i] = tmp_range;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Merge adjacent reserved ranges */
|
/* Merge adjacent reserved ranges */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user