From 193277cf7cec12ca43ab0d215e1bcb6d5425d487 Mon Sep 17 00:00:00 2001 From: Lucas Jeffrey Date: Sat, 1 Aug 2026 14:36:24 -0300 Subject: [PATCH] staging: axis-fifo: use size_t for write size calculations The write length is provided as size_t, but words_to_write and the return value storage used narrower types (int and unsigned int). Use size_t for the word count and ssize_t for the return value to keep the types consistent with the write interface. This is purely a cleanup. The VFS already bounds the write length before the driver is called, so this does not change runtime behavior. Signed-off-by: Lucas Jeffrey Link: https://patch.msgid.link/20260801173624.106971-1-luquijeffrey@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/axis-fifo/axis-fifo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c index 3d358f919352..7bb35e11d1dd 100644 --- a/drivers/staging/axis-fifo/axis-fifo.c +++ b/drivers/staging/axis-fifo/axis-fifo.c @@ -212,9 +212,9 @@ static ssize_t axis_fifo_write(struct file *f, const char __user *buf, size_t len, loff_t *off) { struct axis_fifo *fifo = f->private_data; - unsigned int words_to_write; + size_t words_to_write; u32 *txbuf; - int ret; + ssize_t ret; words_to_write = len / sizeof(u32); @@ -256,7 +256,7 @@ static ssize_t axis_fifo_write(struct file *f, const char __user *buf, goto end_unlock; } - for (int i = 0; i < words_to_write; ++i) + for (size_t i = 0; i < words_to_write; ++i) iowrite32(txbuf[i], fifo->base_addr + XLLF_TDFD_OFFSET); iowrite32(len, fifo->base_addr + XLLF_TLR_OFFSET);