linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/1] Revert "um: Use swap() to make code cleaner"
@ 2023-07-24 14:31 Andy Shevchenko
  2023-07-24 16:26 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2023-07-24 14:31 UTC (permalink / raw)
  To: Andy Shevchenko, linux-um, linux-kernel
  Cc: Richard Weinberger, Anton Ivanov, Johannes Berg,
	Rasmus Villemoes, Andrew Morton, Herve Codina,
	Jason A. Donenfeld, Yang Guang, kernel test robot

This reverts commit 9b0da3f22307af693be80f5d3a89dc4c7f360a85.

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.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202307212304.cH79zJp1-lkp@intel.com/
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v2: fixed typo (h --> c), added Reported-by tag
 arch/um/os-Linux/sigio.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/um/os-Linux/sigio.c b/arch/um/os-Linux/sigio.c
index 37d60e72cf26..9e71794839e8 100644
--- a/arch/um/os-Linux/sigio.c
+++ b/arch/um/os-Linux/sigio.c
@@ -3,7 +3,6 @@
  * Copyright (C) 2002 - 2008 Jeff Dike (jdike@{addtoit,linux.intel}.com)
  */
 
-#include <linux/minmax.h>
 #include <unistd.h>
 #include <errno.h>
 #include <fcntl.h>
@@ -51,7 +50,7 @@ static struct pollfds all_sigio_fds;
 
 static int write_sigio_thread(void *unused)
 {
-	struct pollfds *fds;
+	struct pollfds *fds, tmp;
 	struct pollfd *p;
 	int i, n, respond_fd;
 	char c;
@@ -78,7 +77,9 @@ static int write_sigio_thread(void *unused)
 					       "write_sigio_thread : "
 					       "read on socket failed, "
 					       "err = %d\n", errno);
-				swap(current_poll, next_poll);
+				tmp = current_poll;
+				current_poll = next_poll;
+				next_poll = tmp;
 				respond_fd = sigio_private[1];
 			}
 			else {
-- 
2.40.0.1.gaa8946217a0b


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

* Re: [PATCH v2 1/1] Revert "um: Use swap() to make code cleaner"
  2023-07-24 14:31 [PATCH v2 1/1] Revert "um: Use swap() to make code cleaner" Andy Shevchenko
@ 2023-07-24 16:26 ` Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2023-07-24 16:26 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: linux-um, linux-kernel, Richard Weinberger, Anton Ivanov,
	Johannes Berg, Rasmus Villemoes, Herve Codina,
	Jason A. Donenfeld, Yang Guang, kernel test robot

On Mon, 24 Jul 2023 17:31:31 +0300 Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> This reverts commit 9b0da3f22307af693be80f5d3a89dc4c7f360a85.
> 
> 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.

As it fixes a build error I'll add cc:stable to this.

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

end of thread, other threads:[~2023-07-24 16:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-24 14:31 [PATCH v2 1/1] Revert "um: Use swap() to make code cleaner" Andy Shevchenko
2023-07-24 16:26 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).