[PATCH 273/437] watchdog: rc32434_wdt: convert to read/write iterators

Jens Axboe
2024-04-11T15:39:15Z

drivers/watchdog/rc32434_wdt.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/watchdog/rc32434_wdt.c b/drivers/watchdog/rc32434_wdt.c
index 417f9b75679c..76c046c9beb9 100644
--- a/drivers/watchdog/rc32434_wdt.c
+++ b/drivers/watchdog/rc32434_wdt.c
@@ -161,9 +161,9 @@ static int rc32434_wdt_release(struct inode *inode, struct file *file)
return 0;
}

-static ssize_t rc32434_wdt_write(struct file *file, const char *data,
- size_t len, loff_t *ppos)
+static ssize_t rc32434_wdt_write(struct kiocb *iocb, struct iov_iter *from)
{
+ size_t len = iov_iter_count(from);
if (len) {
if (!nowayout) {
size_t i;
@@ -173,7 +173,7 @@ static ssize_t rc32434_wdt_write(struct file *file, const char *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;
@@ -243,7 +243,7 @@ static long rc32434_wdt_ioctl(struct file *file, unsigned int cmd,
static const struct file_operations rc32434_wdt_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
- .write = rc32434_wdt_write,
+ .write_iter = rc32434_wdt_write,
.unlocked_ioctl = rc32434_wdt_ioctl,
.compat_ioctl = compat_ptr_ioctl,
.open = rc32434_wdt_open,
--
2.43.0