2021-12-18 01:59:31

by David Yang

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

From: Yang Guang <[email protected]>

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

Reported-by: Zeal Robot <[email protected]>
Signed-off-by: David Yang <[email protected]>
Signed-off-by: Yang Guang <[email protected]>
---
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



2021-12-26 21:54:08

by Michael Ellerman

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

On Sat, 18 Dec 2021 09:59:17 +0800, [email protected] wrote:
> From: Yang Guang <[email protected]>
>
> 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