[PATCH 235/437] watchdog: alim1535_wdt: convert to read/write iterators

Jens Axboe posted 437 patches 1 year, 8 months ago
[PATCH 235/437] watchdog: alim1535_wdt: convert to read/write iterators
Posted by Jens Axboe 1 year, 8 months ago
Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
 drivers/watchdog/alim1535_wdt.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/watchdog/alim1535_wdt.c b/drivers/watchdog/alim1535_wdt.c
index bfb9a91ca1df..9a12706d9cdf 100644
--- a/drivers/watchdog/alim1535_wdt.c
+++ b/drivers/watchdog/alim1535_wdt.c
@@ -134,9 +134,9 @@ static int ali_settimer(int t)
  *	the next close to turn off the watchdog.
  */
 
-static ssize_t ali_write(struct file *file, const char __user *data,
-						size_t len, loff_t *ppos)
+static ssize_t ali_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) {
@@ -150,7 +150,7 @@ static ssize_t ali_write(struct file *file, const char __user *data,
 			   the magic character */
 			for (i = 0; i != len; i++) {
 				char c;
-				if (get_user(c, data + i))
+				if (get_iter(c, from))
 					return -EFAULT;
 				if (c == 'V')
 					ali_expect_release = 42;
@@ -360,7 +360,7 @@ static int __init ali_find_watchdog(void)
 static const struct file_operations ali_fops = {
 	.owner		=	THIS_MODULE,
 	.llseek		=	no_llseek,
-	.write		=	ali_write,
+	.write_iter	=	ali_write,
 	.unlocked_ioctl =	ali_ioctl,
 	.compat_ioctl	= 	compat_ptr_ioctl,
 	.open		=	ali_open,
-- 
2.43.0