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>
This commit is contained in:
committed by
Richard Weinberger
parent
4c1f795773
commit
9b0da3f223
@@ -3,6 +3,7 @@
|
|||||||
* Copyright (C) 2002 - 2008 Jeff Dike (jdike@{addtoit,linux.intel}.com)
|
* Copyright (C) 2002 - 2008 Jeff Dike (jdike@{addtoit,linux.intel}.com)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <linux/minmax.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
@@ -50,7 +51,7 @@ static struct pollfds all_sigio_fds;
|
|||||||
|
|
||||||
static int write_sigio_thread(void *unused)
|
static int write_sigio_thread(void *unused)
|
||||||
{
|
{
|
||||||
struct pollfds *fds, tmp;
|
struct pollfds *fds;
|
||||||
struct pollfd *p;
|
struct pollfd *p;
|
||||||
int i, n, respond_fd;
|
int i, n, respond_fd;
|
||||||
char c;
|
char c;
|
||||||
@@ -77,9 +78,7 @@ static int write_sigio_thread(void *unused)
|
|||||||
"write_sigio_thread : "
|
"write_sigio_thread : "
|
||||||
"read on socket failed, "
|
"read on socket failed, "
|
||||||
"err = %d\n", errno);
|
"err = %d\n", errno);
|
||||||
tmp = current_poll;
|
swap(current_poll, next_poll);
|
||||||
current_poll = next_poll;
|
|
||||||
next_poll = tmp;
|
|
||||||
respond_fd = sigio_private[1];
|
respond_fd = sigio_private[1];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user