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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240411153126.16201-382-axboe@kernel.dk>
Date: Thu, 11 Apr 2024 09:18:41 -0600
From: Jens Axboe <axboe@...nel.dk>
To: linux-kernel@...r.kernel.org
Cc: Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 381/437] iio: bno055: convert to read/write iterators

Signed-off-by: Jens Axboe <axboe@...nel.dk>
---
 drivers/iio/imu/bno055/bno055.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/imu/bno055/bno055.c b/drivers/iio/imu/bno055/bno055.c
index 52744dd98e65..729b42e31757 100644
--- a/drivers/iio/imu/bno055/bno055.c
+++ b/drivers/iio/imu/bno055/bno055.c
@@ -1269,10 +1269,9 @@ static int bno055_debugfs_reg_access(struct iio_dev *iio_dev, unsigned int reg,
 		return regmap_write(priv->regmap, reg, writeval);
 }
 
-static ssize_t bno055_show_fw_version(struct file *file, char __user *userbuf,
-				      size_t count, loff_t *ppos)
+static ssize_t bno055_show_fw_version( struct kiocb *iocb, struct iov_iter *to)
 {
-	struct bno055_priv *priv = file->private_data;
+	struct bno055_priv *priv = iocb->ki_filp->private_data;
 	int rev, ver;
 	char *buf;
 	int ret;
@@ -1289,7 +1288,7 @@ static ssize_t bno055_show_fw_version(struct file *file, char __user *userbuf,
 	if (!buf)
 		return -ENOMEM;
 
-	ret = simple_read_from_buffer(userbuf, count, ppos, buf, strlen(buf));
+	ret = simple_copy_to_iter(buf, &iocb->ki_pos, strlen(buf), to);
 	kfree(buf);
 
 	return ret;
@@ -1297,7 +1296,7 @@ static ssize_t bno055_show_fw_version(struct file *file, char __user *userbuf,
 
 static const struct file_operations bno055_fw_version_ops = {
 	.open = simple_open,
-	.read = bno055_show_fw_version,
+	.read_iter = bno055_show_fw_version,
 	.llseek = default_llseek,
 	.owner = THIS_MODULE,
 };
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ