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-380-axboe@kernel.dk>
Date: Thu, 11 Apr 2024 09:18:39 -0600
From: Jens Axboe <axboe@...nel.dk>
To: linux-kernel@...r.kernel.org
Cc: Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 379/437] iio: adis16475: convert to read/write iterators

Signed-off-by: Jens Axboe <axboe@...nel.dk>
---
 drivers/iio/imu/adis16475.c | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/drivers/iio/imu/adis16475.c b/drivers/iio/imu/adis16475.c
index 01f55cc902fa..6772ca783e9d 100644
--- a/drivers/iio/imu/adis16475.c
+++ b/drivers/iio/imu/adis16475.c
@@ -142,11 +142,10 @@ MODULE_PARM_DESC(low_rate_allow,
 		 "Allow IMU rates below the minimum advisable when external clk is used in SCALED mode (default: N)");
 
 #ifdef CONFIG_DEBUG_FS
-static ssize_t adis16475_show_firmware_revision(struct file *file,
-						char __user *userbuf,
-						size_t count, loff_t *ppos)
+static ssize_t adis16475_show_firmware_revision(struct kiocb *iocb,
+						struct iov_iter *to)
 {
-	struct adis16475 *st = file->private_data;
+	struct adis16475 *st = iocb->ki_filp->private_data;
 	char buf[7];
 	size_t len;
 	u16 rev;
@@ -158,21 +157,20 @@ static ssize_t adis16475_show_firmware_revision(struct file *file,
 
 	len = scnprintf(buf, sizeof(buf), "%x.%x\n", rev >> 8, rev & 0xff);
 
-	return simple_read_from_buffer(userbuf, count, ppos, buf, len);
+	return simple_copy_to_iter(buf, &iocb->ki_pos, len, to);
 }
 
 static const struct file_operations adis16475_firmware_revision_fops = {
 	.open = simple_open,
-	.read = adis16475_show_firmware_revision,
+	.read_iter = adis16475_show_firmware_revision,
 	.llseek = default_llseek,
 	.owner = THIS_MODULE,
 };
 
-static ssize_t adis16475_show_firmware_date(struct file *file,
-					    char __user *userbuf,
-					    size_t count, loff_t *ppos)
+static ssize_t adis16475_show_firmware_date(struct kiocb *iocb,
+					    struct iov_iter *to)
 {
-	struct adis16475 *st = file->private_data;
+	struct adis16475 *st = iocb->ki_filp->private_data;
 	u16 md, year;
 	char buf[12];
 	size_t len;
@@ -189,12 +187,12 @@ static ssize_t adis16475_show_firmware_date(struct file *file,
 	len = snprintf(buf, sizeof(buf), "%.2x-%.2x-%.4x\n", md >> 8, md & 0xff,
 		       year);
 
-	return simple_read_from_buffer(userbuf, count, ppos, buf, len);
+	return simple_copy_to_iter(buf, &iocb->ki_pos, len, to);
 }
 
 static const struct file_operations adis16475_firmware_date_fops = {
 	.open = simple_open,
-	.read = adis16475_show_firmware_date,
+	.read_iter = adis16475_show_firmware_date,
 	.llseek = default_llseek,
 	.owner = THIS_MODULE,
 };
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ