[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20211104010951.1027348-1-yang.guang5@zte.com.cn>
Date: Thu, 4 Nov 2021 09:09:51 +0800
From: davidcomponentone@...il.com
To: benh@...nel.crashing.org
Cc: davidcomponentone@...il.com, mpe@...erman.id.au, paulus@...ba.org,
linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
zealci@....com.cn, yang.guang5@....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/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