mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] um: use swap() to make code cleaner
@ 2021-11-04  6:16 davidcomponentone
  2021-11-04 11:10 ` kernel test robot
  2021-11-04 14:11 ` Anton Ivanov
  0 siblings, 2 replies; 6+ messages in thread
From: davidcomponentone @ 2021-11-04  6:16 UTC (permalink / raw)
  To: jdike
  Cc: davidcomponentone, richard, anton.ivanov, johannes.berg,
	yang.guang5, linux-um, linux-kernel, Zeal Robot

From: Yang Guang <yang.guang5@zte.com.cn>

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>
---
 arch/um/os-Linux/sigio.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/um/os-Linux/sigio.c b/arch/um/os-Linux/sigio.c
index 9e71794839e8..1eb15f3cfdc8 100644
--- a/arch/um/os-Linux/sigio.c
+++ b/arch/um/os-Linux/sigio.c
@@ -50,7 +50,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 +77,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 {
-- 
2.30.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-11-05 11:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-04  6:16 [PATCH] um: use swap() to make code cleaner davidcomponentone
2021-11-04 11:10 ` kernel test robot
2021-11-04 14:11 ` Anton Ivanov
2021-11-05  6:12   ` [PATCH v2] " davidcomponentone
2021-11-05  6:18     ` Yang Guang
2021-11-05 11:30     ` David Laight

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®