The membuff implementation curently has no tests. It also assumes that head and tail can never correspond unless the buffer is empty.
This series provides a compile-time flag to support a 'full' flag. It also adds some tests of the main routines. The data structure is also renamed to membuf which fits better with U-Boot. There may be some cases in the code which could be optimised a little, but the implementation is functional. Changes in v2: - Rebase to -next - Drop patch with the 'full' flag Simon Glass (7): membuff: Rename functions to have membuf_ prefix membuff: Rename the files to membuf membuf: Rename struct membuf: Include stdbool membuf: Correct implementation of membuf_dispose() membuf: Add some tests membuf: Minor code-style improvements MAINTAINERS | 7 + arch/sandbox/include/asm/serial.h | 2 +- boot/bootmeth_extlinux.c | 8 +- common/console.c | 32 ++-- drivers/serial/sandbox.c | 10 +- drivers/usb/emul/sandbox_keyb.c | 8 +- include/asm-generic/global_data.h | 6 +- include/{membuff.h => membuf.h} | 92 ++++++------ lib/Makefile | 2 +- lib/{membuff.c => membuf.c} | 73 ++++----- test/lib/Makefile | 1 + test/lib/membuf.c | 239 ++++++++++++++++++++++++++++++ 12 files changed, 366 insertions(+), 114 deletions(-) rename include/{membuff.h => membuf.h} (68%) rename lib/{membuff.c => membuf.c} (79%) create mode 100644 test/lib/membuf.c -- 2.43.0