> Hmm.. Something like
>
> #define timeout_expired(x) time_after(jiffies, (x))
>
> migth indeed make sense.
>
> But I'm a lazy bastard. Is there some victim^H^H^H^H^H^Hhero who would
> want to do the 'sed s/time_after(jiffies,/timeout_expired(/g' and verify
> that it does the right thing and send it to me as a patch?
>
> The thing is, I wonder if it should be "time_after(jiffies,x)" or
> "time_after_eq(jiffies,x)". There's a single-tick difference there..
>
If you allow a lazy victim to throw in some statistics first: ;-)
299 potential users preferring time_after_eq, and 160 voting for
time_after (assuming use of !timeout_expired(x), too):
linux-2.5.13> find ./ -name "*.[ch]" -exec grep "time_before(*jiffies"
/dev/null {} \; | wc -l
248
linux-2.5.13> find ./ -name "*.[ch]" -exec grep "time_before_eq( *jiffies"
/dev/null {} \; | wc -l
20
linux-2.5.13> find ./ -name "*.[ch]" -exec grep "time_after( *jiffies"
/dev/null {} \; | wc -l
140
linux-2.5.13> find ./ -name "*.[ch]" -exec grep "time_after_eq( *jiffies"
/dev/null {} \; | wc -l
51
That probably means we need both, as something like
timeout_expired(x+1) seems to call for new "off by one" errors.
Tim
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/