ring_buffer: make finish methods final

Make it possible to "finish" with fewer bytes than what was "claimed".

This was possible before on the get side, but the put side was
cummulative wrt finish. The revamp made it cummulative on both sides.
Turns out that existing users rely on the opposite behavior which is
more logical and useful. So make both sides that way.

Adjust documentation, test case and users accordingly.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
This commit is contained in:
Nicolas Pitre 2022-02-25 13:20:23 -05:00 committed by Carles Cufí
commit eee5b8e563
5 changed files with 16 additions and 18 deletions

View file

@ -62,6 +62,7 @@ static void rng_pool_work_handler(struct k_work *work)
ring_buf_put_finish(&rnd_rbuf, len);
return;
}
ring_buf_put_finish(&rnd_rbuf, 0);
}
k_work_submit(work);