[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240411153126.16201-247-axboe@kernel.dk>
Date: Thu, 11 Apr 2024 09:16:26 -0600
From: Jens Axboe <axboe@...nel.dk>
To: linux-kernel@...r.kernel.org
Cc: Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 246/437] watchdog: nv_tco: convert to read/write iterators
Signed-off-by: Jens Axboe <axboe@...nel.dk>
---
drivers/watchdog/nv_tco.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/watchdog/nv_tco.c b/drivers/watchdog/nv_tco.c
index ac4a9c16341d..e9535ba7eba7 100644
--- a/drivers/watchdog/nv_tco.c
+++ b/drivers/watchdog/nv_tco.c
@@ -174,9 +174,9 @@ static int nv_tco_release(struct inode *inode, struct file *file)
return 0;
}
-static ssize_t nv_tco_write(struct file *file, const char __user *data,
- size_t len, loff_t *ppos)
+static ssize_t nv_tco_write(struct kiocb *iocb, struct iov_iter *from)
{
+ size_t len = iov_iter_count(from);
/* See if we got the magic character 'V' and reload the timer */
if (len) {
if (!nowayout) {
@@ -194,7 +194,7 @@ static ssize_t nv_tco_write(struct file *file, const char __user *data,
*/
for (i = 0; i != len; i++) {
char c;
- if (get_user(c, data + i))
+ if (get_iter(c, from))
return -EFAULT;
if (c == 'V')
tco_expect_close = 42;
@@ -265,7 +265,7 @@ static long nv_tco_ioctl(struct file *file, unsigned int cmd,
static const struct file_operations nv_tco_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
- .write = nv_tco_write,
+ .write_iter = nv_tco_write,
.unlocked_ioctl = nv_tco_ioctl,
.compat_ioctl = compat_ptr_ioctl,
.open = nv_tco_open,
--
2.43.0
Powered by blists - more mailing lists