Re: [RFC, 2.6] a simple FIFO implementation

From: Stelian Pop
Date: Fri Sep 17 2004 - 05:29:14 EST


On Thu, Sep 16, 2004 at 11:57:34AM -0400, Bill Davidsen wrote:

> >An initial implementation follows below. Comments ?
>
> Many.
>
> - you don't need both size and len, just the length
> - you don't need a count of what's in the fifo, calc from tail-head

The second patch already did that.

> - you don't need remaining, when the tail reaches the head
> you're out of data.
> - you want to do at most two memcpy operations, the loop is just
> unproductive overhead.
> - if the fifo goes empty set the head and tail back to zero so you don't
> wrap (assumes doing just two memcpy ops) when you don't need to

I hope the third patch (which I just posted) answers those points too.

Thanks.

Stelian.
--
Stelian Pop <stelian@xxxxxxxxxx>
-
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/