[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240411153126.16201-270-axboe@kernel.dk>
Date: Thu, 11 Apr 2024 09:16:49 -0600
From: Jens Axboe <axboe@...nel.dk>
To: linux-kernel@...r.kernel.org
Cc: Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 269/437] watchdog: mixcomwd: convert to read/write iterators
Signed-off-by: Jens Axboe <axboe@...nel.dk>
---
drivers/watchdog/mixcomwd.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/watchdog/mixcomwd.c b/drivers/watchdog/mixcomwd.c
index d387bad377c4..c980e542c31b 100644
--- a/drivers/watchdog/mixcomwd.c
+++ b/drivers/watchdog/mixcomwd.c
@@ -166,9 +166,10 @@ static int mixcomwd_release(struct inode *inode, struct file *file)
}
-static ssize_t mixcomwd_write(struct file *file, const char __user *data,
- size_t len, loff_t *ppos)
+static ssize_t mixcomwd_write(struct kiocb *iocb, struct iov_iter *from)
{
+ size_t len = iov_iter_count(from);
+
if (len) {
if (!nowayout) {
size_t i;
@@ -178,7 +179,7 @@ static ssize_t mixcomwd_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')
expect_close = 42;
@@ -225,7 +226,7 @@ static long mixcomwd_ioctl(struct file *file,
static const struct file_operations mixcomwd_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
- .write = mixcomwd_write,
+ .write_iter = mixcomwd_write,
.unlocked_ioctl = mixcomwd_ioctl,
.compat_ioctl = compat_ptr_ioctl,
.open = mixcomwd_open,
--
2.43.0
Powered by blists - more mailing lists