lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240411153126.16201-417-axboe@kernel.dk>
Date: Thu, 11 Apr 2024 09:19:16 -0600
From: Jens Axboe <axboe@...nel.dk>
To: linux-kernel@...r.kernel.org
Cc: Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 416/437] media/platform: amphion: convert to read/write iterators

Signed-off-by: Jens Axboe <axboe@...nel.dk>
---
 drivers/media/platform/amphion/vpu_dbg.c | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/drivers/media/platform/amphion/vpu_dbg.c b/drivers/media/platform/amphion/vpu_dbg.c
index 940e5bda5fa3..71c752081ab3 100644
--- a/drivers/media/platform/amphion/vpu_dbg.c
+++ b/drivers/media/platform/amphion/vpu_dbg.c
@@ -353,21 +353,19 @@ static int vpu_dbg_inst_open(struct inode *inode, struct file *filp)
 	return single_open(filp, vpu_dbg_instance, inode->i_private);
 }
 
-static ssize_t vpu_dbg_inst_write(struct file *file,
-				  const char __user *user_buf, size_t size, loff_t *ppos)
+static ssize_t vpu_dbg_inst_write(struct kiocb *iocb, struct iov_iter *from)
 {
-	struct seq_file *s = file->private_data;
+	struct seq_file *s = iocb->ki_filp->private_data;
 	struct vpu_inst *inst = s->private;
 
 	vpu_session_debug(inst);
 
-	return size;
+	return iov_iter_count(from);
 }
 
-static ssize_t vpu_dbg_core_write(struct file *file,
-				  const char __user *user_buf, size_t size, loff_t *ppos)
+static ssize_t vpu_dbg_core_write(struct kiocb *iocb, struct iov_iter *from)
 {
-	struct seq_file *s = file->private_data;
+	struct seq_file *s = iocb->ki_filp->private_data;
 	struct vpu_core *core = s->private;
 
 	pm_runtime_resume_and_get(core->dev);
@@ -382,7 +380,7 @@ static ssize_t vpu_dbg_core_write(struct file *file,
 	mutex_unlock(&core->lock);
 	pm_runtime_put_sync(core->dev);
 
-	return size;
+	return iov_iter_count(from);
 }
 
 static int vpu_dbg_core_open(struct inode *inode, struct file *filp)
@@ -399,23 +397,23 @@ static const struct file_operations vpu_dbg_inst_fops = {
 	.owner = THIS_MODULE,
 	.open = vpu_dbg_inst_open,
 	.release = single_release,
-	.read = seq_read,
-	.write = vpu_dbg_inst_write,
+	.read_iter = seq_read_iter,
+	.write_iter = vpu_dbg_inst_write,
 };
 
 static const struct file_operations vpu_dbg_core_fops = {
 	.owner = THIS_MODULE,
 	.open = vpu_dbg_core_open,
 	.release = single_release,
-	.read = seq_read,
-	.write = vpu_dbg_core_write,
+	.read_iter = seq_read_iter,
+	.write_iter = vpu_dbg_core_write,
 };
 
 static const struct file_operations vpu_dbg_fwlog_fops = {
 	.owner = THIS_MODULE,
 	.open = vpu_dbg_fwlog_open,
 	.release = single_release,
-	.read = seq_read,
+	.read_iter = seq_read_iter,
 };
 
 int vpu_inst_create_dbgfs_file(struct vpu_inst *inst)
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ