]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
staging: axis-fifo: Remove unnecessary zero-length packet check
authorOvidiu Panait <ovidiu.panait.oss@gmail.com>
Sat, 27 Dec 2025 21:26:37 +0000 (23:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 11 Jan 2026 12:54:12 +0000 (13:54 +0100)
Remove the check for zero-length packets as this condition cannot
occur during normal operation. According to the Xilinx AXI4-Stream
FIFO Product Guide (PG080), in the Receive Length Register (RLR)
description: "The smallest packet that can be received is 1 byte."

A zero-length packet would indicate a bug in the IP core itself.

Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com>
Link: https://patch.msgid.link/20251227212640.3321310-6-ovidiu.panait.oss@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/axis-fifo/axis-fifo.c

index bf610e71253ed0b0a4ffbeac013a1bcf71bd8b3a..6d9ff63841689ddc8454a8d6a279747e4fefefda 100644 (file)
@@ -193,11 +193,6 @@ static ssize_t axis_fifo_read(struct file *f, char __user *buf,
 
        bytes_available = ioread32(fifo->base_addr + XLLF_RLR_OFFSET);
        words_available = bytes_available / sizeof(u32);
-       if (!bytes_available) {
-               dev_err(fifo->dt_device, "received a packet of length 0\n");
-               ret = -EIO;
-               goto end_unlock;
-       }
 
        if (bytes_available > len) {
                dev_err(fifo->dt_device, "user read buffer too small (available bytes=%zu user buffer bytes=%zu)\n",