| From | Jens Axboe <> | Subject | [PATCH 261/437] watchdog: wafer5823wdt: convert to read/write iterators | Date | Thu, 11 Apr 2024 09:16:41 -0600 |
| |
Signed-off-by: Jens Axboe <axboe@kernel.dk> --- drivers/watchdog/wafer5823wdt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/watchdog/wafer5823wdt.c b/drivers/watchdog/wafer5823wdt.c index a8a1ed215e1e..64d6317f058f 100644 --- a/drivers/watchdog/wafer5823wdt.c +++ b/drivers/watchdog/wafer5823wdt.c @@ -91,9 +91,9 @@ static void wafwdt_stop(void) inb_p(wdt_stop); } -static ssize_t wafwdt_write(struct file *file, const char __user *buf, - size_t count, loff_t *ppos) +static ssize_t wafwdt_write(struct kiocb *iocb, struct iov_iter *from) { + size_t count = iov_iter_count(from); /* See if we got the magic character 'V' and reload the timer */ if (count) { if (!nowayout) { @@ -106,7 +106,7 @@ static ssize_t wafwdt_write(struct file *file, const char __user *buf, character */ for (i = 0; i != count; i++) { char c; - if (get_user(c, buf + i)) + if (get_iter(c, from)) return -EFAULT; if (c == 'V') expect_close = 42; @@ -228,7 +228,7 @@ static int wafwdt_notify_sys(struct notifier_block *this, unsigned long code, static const struct file_operations wafwdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, - .write = wafwdt_write, + .write_iter = wafwdt_write, .unlocked_ioctl = wafwdt_ioctl, .compat_ioctl = compat_ptr_ioctl, .open = wafwdt_open, -- 2.43.0
|