Re: [PATCH 3/4] kfifo: add kfifo_out_linear{,_ptr}()

From: Andrew Morton
Date: Fri Feb 23 2024 - 21:31:30 EST


On Fri, 23 Feb 2024 12:51:54 +0100 "Jiri Slaby (SUSE)" <jirislaby@xxxxxxxxxx> wrote:

> + return min(n, __kfifo_peek_n(fifo, recsize);

When things like this happen I wonder "was I sent the correct version"
and "was this tested" and "wtf".

Please confirm that with this patch:

--- a/lib/kfifo.c~a
+++ a/lib/kfifo.c
@@ -497,7 +497,7 @@ unsigned int __kfifo_out_linear_r(struct
if (tail)
*tail = fifo->out + recsize;

- return min(n, __kfifo_peek_n(fifo, recsize);
+ return min(n, __kfifo_peek_n(fifo, recsize));
}
EXPORT_SYMBOL(__kfifo_out_linear_r);

@@ -609,4 +609,3 @@ unsigned int __kfifo_dma_out_prepare_r(s
return setup_sgl(fifo, sgl, nents, len, fifo->out + recsize);
}
EXPORT_SYMBOL(__kfifo_dma_out_prepare_r);

we have a fully tested, production quality kernel change?