[PATCH 241/437] watchdog: ib700wdt: convert to read/write iterators

From: Jens Axboe
Date: Thu Apr 11 2024 - 12:34:57 EST


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

diff --git a/drivers/watchdog/ib700wdt.c b/drivers/watchdog/ib700wdt.c
index 39ea97009abd..e5daeed9cd5c 100644
--- a/drivers/watchdog/ib700wdt.c
+++ b/drivers/watchdog/ib700wdt.c
@@ -141,9 +141,9 @@ static int ibwdt_set_heartbeat(int t)
* /dev/watchdog handling
*/

-static ssize_t ibwdt_write(struct file *file, const char __user *buf,
- size_t count, loff_t *ppos)
+static ssize_t ibwdt_write(struct kiocb *iocb, struct iov_iter *from)
{
+ size_t count = iov_iter_count(from);
if (count) {
if (!nowayout) {
size_t i;
@@ -153,7 +153,7 @@ static ssize_t ibwdt_write(struct file *file, const char __user *buf,

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;
@@ -257,7 +257,7 @@ static int ibwdt_close(struct inode *inode, struct file *file)
static const struct file_operations ibwdt_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
- .write = ibwdt_write,
+ .write_iter = ibwdt_write,
.unlocked_ioctl = ibwdt_ioctl,
.compat_ioctl = compat_ptr_ioctl,
.open = ibwdt_open,
--
2.43.0