[PATCH] powerpc: use swap() to make code cleaner

Subsystems: linux for power macintosh, linux for powerpc (32-bit and 64-bit), the rest

STALE1706d LANDED

Landed in mainline as a605b39e8ef7 on 2021-12-20.

2 messages, 2 authors, 2021-12-26 · open the first message on its own page

[PATCH] powerpc: use swap() to make code cleaner

From: <hidden>
Date: 2021-12-18 01:59:31

From: Yang Guang <redacted>

Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid
opencoding it.

Reported-by: Zeal Robot <redacted>
Signed-off-by: David Yang <redacted>
Signed-off-by: Yang Guang <redacted>
---
 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

Re: [PATCH] powerpc: use swap() to make code cleaner

From: Michael Ellerman <hidden>
Date: 2021-12-26 21:54:08

On Sat, 18 Dec 2021 09:59:17 +0800, davidcomponentone@gmail.com wrote:
From: Yang Guang <redacted>

Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid
opencoding it.
Applied to powerpc/next.

[1/1] powerpc: use swap() to make code cleaner
      https://git.kernel.org/powerpc/c/a605b39e8ef703828b9e26750ea1925a6a5ef848

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help