projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2fe4ca6
)
powerpc: use swap() to make code cleaner
author
Yang Guang
<yang.guang5@zte.com.cn>
Sat, 18 Dec 2021 01:59:17 +0000
(09:59 +0800)
committer
Michael Ellerman
<mpe@ellerman.id.au>
Mon, 20 Dec 2021 01:01:21 +0000
(12:01 +1100)
Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid
opencoding it.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: David Yang <davidcomponentone@gmail.com>
Signed-off-by: Yang Guang <yang.guang5@zte.com.cn>
[mpe: Add include of linux/minmax.h]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link:
https://lore.kernel.org/r/71a702c2189b16c152affd8a8cda1d84ce32741c.1639792543.git.yang.guang5@zte.com.cn
arch/powerpc/platforms/powermac/pic.c
patch
|
blob
|
history
diff --git
a/arch/powerpc/platforms/powermac/pic.c
b/arch/powerpc/platforms/powermac/pic.c
index 4921bccf0376be1ea60797a0e7bf950ba17f6417..bb0566633af57f7eb3fe85378ab48d283d783e92 100644
(file)
--- a/
arch/powerpc/platforms/powermac/pic.c
+++ b/
arch/powerpc/platforms/powermac/pic.c
@@
-18,6
+18,7
@@
#include <linux/interrupt.h>
#include <linux/syscore_ops.h>
#include <linux/adb.h>
+#include <linux/minmax.h>
#include <linux/pmu.h>
#include <asm/sections.h>
@@
-311,11
+312,8
@@
static void __init pmac_pic_probe_oldstyle(void)
/* Check ordering of master & slave */
if (of_device_is_compatible(master, "gatwick")) {
- struct device_node *tmp;
BUG_ON(slave == NULL);
- tmp = master;
- master = slave;
- slave = tmp;
+ swap(master, slave);
}
/* We found a slave */