On Mon, 25 Jan 2010 12:01:12 +0100
Kristoffer Glembo [off-list ref] wrote:
+/* Wait for a register change with a timeout, jiffies used has time reference */
+#define wait_loop(wait_statement, timeout, label_on_timeout, arg_on_timeout) \
+ { \
+ unsigned long _timeout = jiffies + HZ/100*timeout; \
+ while (wait_statement) { \
+ if (time_after(jiffies, _timeout)) { \
+ arg_on_timeout; \
+goto label_on_timeout; \
+ } \
+ } \
+ }
Ugly macro used with same arguments, just write a single function
--