Skip to content

Commit dddfa05

Browse files
andy-shevakpm00
authored andcommitted
Revert "um: Use swap() to make code cleaner"
This reverts commit 9b0da3f. The sigio.c is clearly user space code which is handled by arch/um/scripts/Makefile.rules (see USER_OBJS rule). The above mentioned commit simply broke this agreement, we may not use Linux kernel internal headers in them without thorough thinking. Hence, revert the wrong commit. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Andy Shevchenko <[email protected]> Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Cc: Anton Ivanov <[email protected]> Cc: Herve Codina <[email protected]> Cc: Jason A. Donenfeld <[email protected]> Cc: Johannes Berg <[email protected]> Cc: Rasmus Villemoes <[email protected]> Cc: Richard Weinberger <[email protected]> Cc: Yang Guang <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent d1836a3 commit dddfa05

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

arch/um/os-Linux/sigio.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Copyright (C) 2002 - 2008 Jeff Dike (jdike@{addtoit,linux.intel}.com)
44
*/
55

6-
#include <linux/minmax.h>
76
#include <unistd.h>
87
#include <errno.h>
98
#include <fcntl.h>
@@ -51,7 +50,7 @@ static struct pollfds all_sigio_fds;
5150

5251
static int write_sigio_thread(void *unused)
5352
{
54-
struct pollfds *fds;
53+
struct pollfds *fds, tmp;
5554
struct pollfd *p;
5655
int i, n, respond_fd;
5756
char c;
@@ -78,7 +77,9 @@ static int write_sigio_thread(void *unused)
7877
"write_sigio_thread : "
7978
"read on socket failed, "
8079
"err = %d\n", errno);
81-
swap(current_poll, next_poll);
80+
tmp = current_poll;
81+
current_poll = next_poll;
82+
next_poll = tmp;
8283
respond_fd = sigio_private[1];
8384
}
8485
else {

0 commit comments

Comments
 (0)