Re: [RFC, 2.6] a simple FIFO implementation

From: Stelian Pop
Date: Thu Sep 16 2004 - 11:33:53 EST


On Thu, Sep 16, 2004 at 05:51:04PM +0200, Buddy Lucas wrote:

> > No, because the type is *unsigned* int.
>
> Indeed, that would exactly be the reason *why* this would fail. ;-)
>
> The expression fifo->size - fifo->tail + fifo->head might be negative
> at some point, right? (fifo->head has wrapped to some small value and
> fifo->tail > fifo->size)

And what is the value of an unsigned int holding that 'negative' value ? :)

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/