[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240411153126.16201-212-axboe@kernel.dk>
Date: Thu, 11 Apr 2024 09:15:51 -0600
From: Jens Axboe <axboe@...nel.dk>
To: linux-kernel@...r.kernel.org
Cc: Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 211/437] drivers/iommu: convert omap to read/write iterators
Signed-off-by: Jens Axboe <axboe@...nel.dk>
---
drivers/iommu/omap-iommu-debug.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/iommu/omap-iommu-debug.c b/drivers/iommu/omap-iommu-debug.c
index 259f65291d90..46798b7584b5 100644
--- a/drivers/iommu/omap-iommu-debug.c
+++ b/drivers/iommu/omap-iommu-debug.c
@@ -11,6 +11,7 @@
#include <linux/io.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
+#include <linux/uio.h>
#include <linux/pm_runtime.h>
#include <linux/debugfs.h>
#include <linux/platform_data/iommu-omap.h>
@@ -80,10 +81,10 @@ static ssize_t omap_iommu_dump_ctx(struct omap_iommu *obj, char *buf,
return bytes;
}
-static ssize_t debug_read_regs(struct file *file, char __user *userbuf,
- size_t count, loff_t *ppos)
+static ssize_t debug_read_regs(struct kiocb *iocb, struct iov_iter *to)
{
- struct omap_iommu *obj = file->private_data;
+ struct omap_iommu *obj = iocb->ki_filp->private_data;
+ size_t count = iov_iter_count(to);
char *p, *buf;
ssize_t bytes;
@@ -100,7 +101,7 @@ static ssize_t debug_read_regs(struct file *file, char __user *userbuf,
bytes = omap_iommu_dump_ctx(obj, p, count);
if (bytes < 0)
goto err;
- bytes = simple_read_from_buffer(userbuf, count, ppos, buf, bytes);
+ bytes = simple_copy_to_iter(buf, &iocb->ki_pos, bytes, to);
err:
mutex_unlock(&iommu_debug_lock);
@@ -231,7 +232,7 @@ static int pagetable_show(struct seq_file *s, void *data)
#define DEBUG_FOPS_RO(name) \
static const struct file_operations name##_fops = { \
.open = simple_open, \
- .read = debug_read_##name, \
+ .read_iter = debug_read_##name, \
.llseek = generic_file_llseek, \
}
--
2.43.0
Powered by blists - more mailing lists