mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
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 <luquijeffrey@gmail.com> Link: https://patch.msgid.link/20260801173624.106971-1-luquijeffrey@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
42600ab23f
commit
193277cf7c
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user