On 28 January 2014 00:04, Peter Crosthwaite <peter.crosthwa...@xilinx.com> wrote: > On Tue, Jan 28, 2014 at 4:32 AM, Peter Maydell <peter.mayd...@linaro.org> > wrote: >>> void fifo8_reset(Fifo8 *fifo) >>> { >>> fifo->num = 0; >>> + fifo->head = 0; >> >> This is a bug fix, right? It should go in its own patch. >> > > No bug - where the ring buffer starts following a reset is undefined > and need not be defined. But it improves the predicatability of the > newly added pop_buf fn as you can now following a reset, guarantee > that a single pop_buf will take all contents if its the first pop > (which is how its being used in P2).
True. I still think it should have its own patch (and indeed it would be worth saying what you just did as part of the commit message for that patch...) I think it's also nicer for any state that gets migrated to be reset cleanly. thanks -- PMM