aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kfifo.c
diff options
context:
space:
mode:
authorJiri Slaby (SUSE) <jirislaby@kernel.org>2024-04-05 08:08:13 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-04-09 15:28:02 +0200
commit76738194be605c9fb279f87d8a6b0b95904bfb60 (patch)
tree4a6665274a424fdb90b73dd0fe9c43305666aa16 /lib/kfifo.c
parent779087fe2fecf8b8aa7bdd69982f9c0c8266927b (diff)
downloadlinux-76738194be605c9fb279f87d8a6b0b95904bfb60.tar.gz
kfifo: introduce and use kfifo_skip_count()
kfifo_skip_count() is an extended version of kfifo_skip(), accepting also count. This will be useful in the serial code later. Now, it can be used to implement both kfifo_skip() and kfifo_dma_out_finish(). In the latter, 'len' only needs to be divided by 'type' size (as it was until now). And stop using statement expressions when the return value is cast to 'void'. Use classic 'do {} while (0)' instead. Note: perhaps we should skip 'count' records for the 'recsize' case, but the original (kfifo_dma_out_finish()) used to skip only one record. So this is kept unchanged and 'count' is still ignored in the recsize case. Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org> Cc: Stefani Seibold <stefani@seibold.net> Cc: Andrew Morton <akpm@linux-foundation.org> Link: https://lore.kernel.org/r/20240405060826.2521-3-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/kfifo.c')
0 files changed, 0 insertions, 0 deletions