summaryrefslogtreecommitdiffstats
path: root/arch/um
diff options
context:
space:
mode:
authorYang Guang <yang.guang5@zte.com.cn>2021-11-05 14:12:59 +0800
committerRichard Weinberger <richard@nod.at>2021-12-21 21:41:04 +0100
commit9b0da3f22307af693be80f5d3a89dc4c7f360a85 (patch)
treef4450fcd278fb5d041a92030dc5fffc52df5333b /arch/um
parent4c1f795773b3ef6e206ef84bc6a928803fa31b7d (diff)
downloadlinux-9b0da3f22307af693be80f5d3a89dc4c7f360a85.tar.bz2
um: Use swap() to make code cleaner
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: Yang Guang <yang.guang5@zte.com.cn> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um')
-rw-r--r--arch/um/os-Linux/sigio.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/um/os-Linux/sigio.c b/arch/um/os-Linux/sigio.c
index 9e71794839e8..37d60e72cf26 100644
--- a/arch/um/os-Linux/sigio.c
+++ b/arch/um/os-Linux/sigio.c
@@ -3,6 +3,7 @@
* Copyright (C) 2002 - 2008 Jeff Dike (jdike@{addtoit,linux.intel}.com)
*/
+#include <linux/minmax.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
@@ -50,7 +51,7 @@ static struct pollfds all_sigio_fds;
static int write_sigio_thread(void *unused)
{
- struct pollfds *fds, tmp;
+ struct pollfds *fds;
struct pollfd *p;
int i, n, respond_fd;
char c;
@@ -77,9 +78,7 @@ static int write_sigio_thread(void *unused)
"write_sigio_thread : "
"read on socket failed, "
"err = %d\n", errno);
- tmp = current_poll;
- current_poll = next_poll;
- next_poll = tmp;
+ swap(current_poll, next_poll);
respond_fd = sigio_private[1];
}
else {