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-181-axboe@kernel.dk>
Date: Thu, 11 Apr 2024 09:15:20 -0600
From: Jens Axboe <axboe@...nel.dk>
To: linux-kernel@...r.kernel.org
Cc: Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 180/437] drivers/phy: convert to ->read_iter and ->write_iter

Signed-off-by: Jens Axboe <axboe@...nel.dk>
---
 drivers/phy/mediatek/phy-mtk-tphy.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/phy/mediatek/phy-mtk-tphy.c b/drivers/phy/mediatek/phy-mtk-tphy.c
index 25b86bbb9cec..8c57e2d89415 100644
--- a/drivers/phy/mediatek/phy-mtk-tphy.c
+++ b/drivers/phy/mediatek/phy-mtk-tphy.c
@@ -448,19 +448,19 @@ static int u2_phy_params_open(struct inode *inode, struct file *file)
 	return single_open(file, u2_phy_params_show, inode->i_private);
 }
 
-static ssize_t u2_phy_params_write(struct file *file, const char __user *ubuf,
-				   size_t count, loff_t *ppos)
+static ssize_t u2_phy_params_write(struct kiocb *iocb, struct iov_iter *from)
 {
-	const char *fname = file_dentry(file)->d_iname;
-	struct seq_file *sf = file->private_data;
+	const char *fname = file_dentry(iocb->ki_filp)->d_iname;
+	struct seq_file *sf = iocb->ki_filp->private_data;
 	struct mtk_phy_instance *inst = sf->private;
 	struct u2phy_banks *u2_banks = &inst->u2_banks;
+	size_t count = iov_iter_count(from);
 	void __iomem *com = u2_banks->com;
 	ssize_t rc;
 	u32 val;
 	int ret;
 
-	rc = kstrtouint_from_user(ubuf, USER_BUF_LEN(count), 0, &val);
+	rc = kstrtouint_from_iter(from, USER_BUF_LEN(count), 0, &val);
 	if (rc)
 		return rc;
 
@@ -504,8 +504,8 @@ static ssize_t u2_phy_params_write(struct file *file, const char __user *ubuf,
 
 static const struct file_operations u2_phy_fops = {
 	.open = u2_phy_params_open,
-	.write = u2_phy_params_write,
-	.read = seq_read,
+	.write_iter = u2_phy_params_write,
+	.read_iter = seq_read_iter,
 	.llseek = seq_lseek,
 	.release = single_release,
 };
@@ -574,19 +574,19 @@ static int u3_phy_params_open(struct inode *inode, struct file *file)
 	return single_open(file, u3_phy_params_show, inode->i_private);
 }
 
-static ssize_t u3_phy_params_write(struct file *file, const char __user *ubuf,
-				   size_t count, loff_t *ppos)
+static ssize_t u3_phy_params_write(struct kiocb *iocb, struct iov_iter *from)
 {
-	const char *fname = file_dentry(file)->d_iname;
-	struct seq_file *sf = file->private_data;
+	const char *fname = file_dentry(iocb->ki_filp)->d_iname;
+	struct seq_file *sf = iocb->ki_filp->private_data;
 	struct mtk_phy_instance *inst = sf->private;
 	struct u3phy_banks *u3_banks = &inst->u3_banks;
 	void __iomem *phyd = u3_banks->phyd;
+	size_t count = iov_iter_count(from);
 	ssize_t rc;
 	u32 val;
 	int ret;
 
-	rc = kstrtouint_from_user(ubuf, USER_BUF_LEN(count), 0, &val);
+	rc = kstrtouint_from_iter(from, USER_BUF_LEN(count), 0, &val);
 	if (rc)
 		return rc;
 
@@ -624,8 +624,8 @@ static ssize_t u3_phy_params_write(struct file *file, const char __user *ubuf,
 
 static const struct file_operations u3_phy_fops = {
 	.open = u3_phy_params_open,
-	.write = u3_phy_params_write,
-	.read = seq_read,
+	.write_iter = u3_phy_params_write,
+	.read_iter = seq_read_iter,
 	.llseek = seq_lseek,
 	.release = single_release,
 };
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ