On Friday 20 February 2009 07:31:43 Barry Scott wrote:
> I saw this and thought it was wrong.
>
> int
> i915_seqno_passed(uint32_t seq1, uint32_t seq2)
> {
> return (int32_t)(seq1 - seq2) >= 0;
>
> After a bit of thinking I realized that this is doing modulas arithmetic to
> deal with the seqno wrapping around. Given its not obvious at first glance
> you might like to add a comment that to explain?
It's a somewhat common idiom in the kernel, but yeah a comment wouldn't hurt.
--
Jesse Barnes, Intel Open Source Technology Center
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel