[PATCH] fix init_wait macro

From: vlobanov
Date: Thu Dec 16 2004 - 02:52:08 EST


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@xxxxxxxxxxxxx>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/