Skip to content

Commit

Permalink
um: Use swap() to make code cleaner
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yang Guang authored and Richard Weinberger committed Dec 21, 2021
1 parent 4c1f795 commit 9b0da3f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions arch/um/os-Linux/sigio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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;
Expand All @@ -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 {
Expand Down

0 comments on commit 9b0da3f

Please sign in to comment.