From: Minu Jin <s9430939@naver.com>
To: gregkh@linuxfoundation.org
Cc: ovidiu.panait.oss@gmail.com, gshahrouzi@gmail.com,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
lkp@intel.com, Minu Jin <s9430939@naver.com>
Subject: [PATCH v2 2/2] staging: axis-fifo: Use bulk I/O accessors for data transfers
Date: Thu, 15 Jan 2026 11:25:09 +0900 [thread overview]
Message-ID: <20260115022509.3038062-2-s9430939@naver.com> (raw)
In-Reply-To: <20260115022509.3038062-1-s9430939@naver.com>
Replace manual for loops with ioread32_rep/iowrite32_rep.
Add axis_fifo_read_data() and axis_fifo_write_data() wrappers to
encapsulate these block-transfer operations.
No functional changes intended
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202601141928.CyFxDTEk-lkp@intel.com/
Signed-off-by: Minu Jin <s9430939@naver.com>
---
v2:
- Remove unused variable 'i' in axis_fifo_read() to fix build warning
reported by kernel test robot
- Add Reported-by and Closes tags
drivers/staging/axis-fifo/axis-fifo.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c
index 525156583c4a..009333cc398b 100644
--- a/drivers/staging/axis-fifo/axis-fifo.c
+++ b/drivers/staging/axis-fifo/axis-fifo.c
@@ -150,11 +150,21 @@ static inline u32 axis_fifo_read_reg(struct axis_fifo *fifo, int offset)
return ioread32(fifo->base_addr + offset);
}
+static inline void axis_fifo_read_data(struct axis_fifo *fifo, void *buf, int count)
+{
+ ioread32_rep(fifo->base_addr + XLLF_RDFD_OFFSET, buf, count);
+}
+
static inline void axis_fifo_write_reg(struct axis_fifo *fifo, int offset, u32 val)
{
iowrite32(val, fifo->base_addr + offset);
}
+static inline void axis_fifo_write_data(struct axis_fifo *fifo, const void *buf, int count)
+{
+ iowrite32_rep(fifo->base_addr + XLLF_TDFD_OFFSET, buf, count);
+}
+
static void reset_ip_core(struct axis_fifo *fifo)
{
axis_fifo_write_reg(fifo, XLLF_SRR_OFFSET, XLLF_SRR_RESET_MASK);
@@ -190,7 +200,6 @@ static ssize_t axis_fifo_read(struct file *f, char __user *buf,
unsigned int words_available;
unsigned int copied;
unsigned int copy;
- unsigned int i;
int ret;
u32 tmp_buf[READ_BUF_SIZE];
@@ -259,10 +268,8 @@ static ssize_t axis_fifo_read(struct file *f, char __user *buf,
while (words_available > 0) {
copy = min(words_available, READ_BUF_SIZE);
- for (i = 0; i < copy; i++) {
- tmp_buf[i] = ioread32(fifo->base_addr +
- XLLF_RDFD_OFFSET);
- }
+ axis_fifo_read_data(fifo, tmp_buf, copy);
+
words_available -= copy;
if (copy_to_user(buf + copied * sizeof(u32), tmp_buf,
@@ -378,8 +385,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)
- iowrite32(txbuf[i], fifo->base_addr + XLLF_TDFD_OFFSET);
+ axis_fifo_write_data(fifo, txbuf, words_to_write);
/* write packet size to fifo */
axis_fifo_write_reg(fifo, XLLF_TLR_OFFSET, len);
--
2.43.0
next prev parent reply other threads:[~2026-01-15 2:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-15 2:25 [PATCH v2 1/2] staging: axis-fifo: introduce helper functions for register access Minu Jin
2026-01-15 2:25 ` Minu Jin [this message]
2026-01-15 11:29 ` [PATCH v2 2/2] staging: axis-fifo: Use bulk I/O accessors for data transfers Greg KH
2026-01-15 11:30 ` Greg KH
2026-01-15 11:24 ` [PATCH v2 1/2] staging: axis-fifo: introduce helper functions for register access Greg KH
2026-01-15 11:30 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2026-01-14 13:23 Minu Jin
2026-01-14 13:23 ` [PATCH v2 2/2] staging: axis-fifo: Use bulk I/O accessors for data transfers Minu Jin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260115022509.3038062-2-s9430939@naver.com \
--to=s9430939@naver.com \
--cc=gregkh@linuxfoundation.org \
--cc=gshahrouzi@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=lkp@intel.com \
--cc=ovidiu.panait.oss@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®