mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fix init_wait macro
@ 2004-12-16  7:50 vlobanov
  0 siblings, 0 replies; only message in thread
From: vlobanov @ 2004-12-16  7:50 UTC (permalink / raw)
  To: linux-kernel

Hello,

In looking through bugzilla.kernel.org, I found a rather old and easy
bug still laying around unfixed:
  bug #3863 (http://bugzilla.kernel.org/show_bug.cgi?id=3863)

The patch is straightforward -- wrap the macro argument in parentheses,
to prevent incorrect operator binding. Applies against 2.6.10-rc3.

======================================================
diff -Nru a/include/linux/wait.h b/include/linux/wait.h
--- a/include/linux/wait.h	2004-12-04 23:00:18.000000000 -0800
+++ b/include/linux/wait.h	2004-12-15 22:51:58.000000000 -0800
@@ -344,9 +344,9 @@

 #define init_wait(wait)							\
 	do {								\
-		wait->task = current;					\
-		wait->func = autoremove_wake_function;			\
-		INIT_LIST_HEAD(&wait->task_list);			\
+		(wait)->task = current;					\
+		(wait)->func = autoremove_wake_function;		\
+		INIT_LIST_HEAD(&(wait)->task_list);			\
 	} while (0)

 /**
======================================================

Let me know if there are any objections to this patch, though I do not
foresee any. Since this is a general patch, I should forward it to Linux
or Rusty, though not sure who would be best in this case.

Signed-off-by: Vadim Lobanov <vlobanov@speakeasy.net>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-12-16  7:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-16  7:50 [PATCH] fix init_wait macro vlobanov

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®