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-164-axboe@kernel.dk>
Date: Thu, 11 Apr 2024 09:15:03 -0600
From: Jens Axboe <axboe@...nel.dk>
To: linux-kernel@...r.kernel.org
Cc: Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 163/437] usb: host: ehci: convert to read/write iterators

Signed-off-by: Jens Axboe <axboe@...nel.dk>
---
 drivers/usb/host/ehci-dbg.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c
index c063fb042926..c9390a17c432 100644
--- a/drivers/usb/host/ehci-dbg.c
+++ b/drivers/usb/host/ehci-dbg.c
@@ -293,13 +293,13 @@ static int debug_bandwidth_open(struct inode *, struct file *);
 static int debug_periodic_open(struct inode *, struct file *);
 static int debug_registers_open(struct inode *, struct file *);
 
-static ssize_t debug_output(struct file*, char __user*, size_t, loff_t*);
+static ssize_t debug_output(struct kiocb *, struct iov_iter *);
 static int debug_close(struct inode *, struct file *);
 
 static const struct file_operations debug_async_fops = {
 	.owner		= THIS_MODULE,
 	.open		= debug_async_open,
-	.read		= debug_output,
+	.read_iter	= debug_output,
 	.release	= debug_close,
 	.llseek		= default_llseek,
 };
@@ -307,7 +307,7 @@ static const struct file_operations debug_async_fops = {
 static const struct file_operations debug_bandwidth_fops = {
 	.owner		= THIS_MODULE,
 	.open		= debug_bandwidth_open,
-	.read		= debug_output,
+	.read_iter	= debug_output,
 	.release	= debug_close,
 	.llseek		= default_llseek,
 };
@@ -315,7 +315,7 @@ static const struct file_operations debug_bandwidth_fops = {
 static const struct file_operations debug_periodic_fops = {
 	.owner		= THIS_MODULE,
 	.open		= debug_periodic_open,
-	.read		= debug_output,
+	.read_iter	= debug_output,
 	.release	= debug_close,
 	.llseek		= default_llseek,
 };
@@ -323,7 +323,7 @@ static const struct file_operations debug_periodic_fops = {
 static const struct file_operations debug_registers_fops = {
 	.owner		= THIS_MODULE,
 	.open		= debug_registers_open,
-	.read		= debug_output,
+	.read_iter	= debug_output,
 	.release	= debug_close,
 	.llseek		= default_llseek,
 };
@@ -952,10 +952,9 @@ static int fill_buffer(struct debug_buffer *buf)
 	return ret;
 }
 
-static ssize_t debug_output(struct file *file, char __user *user_buf,
-		size_t len, loff_t *offset)
+static ssize_t debug_output(struct kiocb *iocb, struct iov_iter *to)
 {
-	struct debug_buffer *buf = file->private_data;
+	struct debug_buffer *buf = iocb->ki_filp->private_data;
 	int ret;
 
 	mutex_lock(&buf->mutex);
@@ -968,9 +967,7 @@ static ssize_t debug_output(struct file *file, char __user *user_buf,
 	}
 	mutex_unlock(&buf->mutex);
 
-	ret = simple_read_from_buffer(user_buf, len, offset,
-				      buf->output_buf, buf->count);
-
+	ret = simple_copy_to_iter(buf->output_buf, &iocb->ki_pos, buf->count, to);
 out:
 	return ret;
 }
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ