[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <71a702c2189b16c152affd8a8cda1d84ce32741c.1639792543.git.yang.guang5@zte.com.cn>
Date: Sat, 18 Dec 2021 09:59:17 +0800
From: davidcomponentone@...il.com
To: benh@...nel.crashing.org
Cc: davidcomponentone@...il.com, mpe@...erman.id.au, paulus@...ba.org,
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: David Yang <davidcomponentone@...il.com>
Signed-off-by: Yang Guang <yang.guang5@....com.cn>
---
arch/powerpc/platforms/powermac/pic.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
index 4921bccf0376..75d8d7ec53db 100644
--- a/arch/powerpc/platforms/powermac/pic.c
+++ b/arch/powerpc/platforms/powermac/pic.c
@@ -311,11 +311,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 */
--
2.30.2
Powered by blists - more mailing lists