[PATCH 260/437] watchdog: w83977f_wdt: convert to read/write iterators

From: Jens Axboe
Date: Thu Apr 11 2024 - 12:39:44 EST


Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
---
drivers/watchdog/w83977f_wdt.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/watchdog/w83977f_wdt.c b/drivers/watchdog/w83977f_wdt.c
index 31bf21ceaf48..2b9a8920ac2c 100644
--- a/drivers/watchdog/w83977f_wdt.c
+++ b/drivers/watchdog/w83977f_wdt.c
@@ -324,9 +324,9 @@ static int wdt_release(struct inode *inode, struct file *file)
* write of data will do, as we don't define content meaning.
*/

-static ssize_t wdt_write(struct file *file, const char __user *buf,
- size_t count, loff_t *ppos)
+static ssize_t wdt_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) {
@@ -340,7 +340,7 @@ static ssize_t wdt_write(struct file *file, const char __user *buf,
magic character */
for (ofs = 0; ofs != count; ofs++) {
char c;
- if (get_user(c, buf + ofs))
+ if (get_iter(c, from))
return -EFAULT;
if (c == 'V')
expect_close = 42;
@@ -444,7 +444,7 @@ static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
static const struct file_operations wdt_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
- .write = wdt_write,
+ .write_iter = wdt_write,
.unlocked_ioctl = wdt_ioctl,
.compat_ioctl = compat_ptr_ioctl,
.open = wdt_open,
--
2.43.0