[PATCH 0/4] kfifo: small cleanup + linear and skip helpers

From: Jiri Slaby (SUSE)
Date: Fri Feb 23 2024 - 06:52:04 EST


Hi,

this is a small cleanup of kfifo.

More importantly, it introduces three helpers: kfifo_skip_count(),
kfifo_out_linear() and kfifo_out_linear_ptr(). They allow using kfifo in
the serial layer.

They are needed as up to now, there is no way to "peek" the data without
actually copying to a temporary buffer. kfifo_out_linear*() allow that
and kfifo_skip_count() then allows for tail moving after the copy is
done. Note the copy is usually performed directly to hardware e.g. via
outb(), hence the need for peek without copying anywhere.

Jiri Slaby (SUSE) (4):
kfifo: drop __kfifo_dma_out_finish_r()
kfifo: introduce and use kfifo_skip_count()
kfifo: add kfifo_out_linear{,_ptr}()
kfifo: fix typos in kernel-doc

include/linux/kfifo.h | 105 +++++++++++++++++++++++++++++++++---------
lib/kfifo.c | 36 +++++++++++----
2 files changed, 111 insertions(+), 30 deletions(-)

--
2.43.2