projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ca34cda
)
s390/vmem: use swap() instead of open coding it
author
Jiapeng Chong
<jiapeng.chong@linux.alibaba.com>
Tue, 17 Jan 2023 06:02:23 +0000
(14:02 +0800)
committer
Heiko Carstens
<hca@linux.ibm.com>
Sun, 22 Jan 2023 17:42:34 +0000
(18:42 +0100)
Swap is a function interface that provides exchange function. To avoid
code duplication, we can use swap function.
./arch/s390/mm/vmem.c:680:10-11: WARNING opportunity for swap().
[hca@linux.ibm.com: get rid of all temp variables]
Link:
https://bugzilla.openanolis.cn/show_bug.cgi?id=3786
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Link:
https://lore.kernel.org/r/20230117060223.58583-1-jiapeng.chong@linux.alibaba.com
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/mm/vmem.c
patch
|
blob
|
history
diff --git
a/arch/s390/mm/vmem.c
b/arch/s390/mm/vmem.c
index
78d7768
..
15daf77
100644
(file)
--- a/
arch/s390/mm/vmem.c
+++ b/
arch/s390/mm/vmem.c
@@
-672,13
+672,7
@@
static int __init memblock_region_cmp(const void *a, const void *b)
static void __init memblock_region_swap(void *a, void *b, int size)
{
- struct memblock_region *r1 = a;
- struct memblock_region *r2 = b;
- struct memblock_region swap;
-
- swap = *r1;
- *r1 = *r2;
- *r2 = swap;
+ swap(*(struct memblock_region *)a, *(struct memblock_region *)b);
}
/*