[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240411153126.16201-235-axboe@kernel.dk>
Date: Thu, 11 Apr 2024 09:16:14 -0600
From: Jens Axboe <axboe@...nel.dk>
To: linux-kernel@...r.kernel.org
Cc: Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 234/437] watchdog: advantechwdt: convert to read/write iterators
Signed-off-by: Jens Axboe <axboe@...nel.dk>
---
drivers/watchdog/advantechwdt.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/watchdog/advantechwdt.c b/drivers/watchdog/advantechwdt.c
index 7a0acbc3e4dd..95c1b90abedc 100644
--- a/drivers/watchdog/advantechwdt.c
+++ b/drivers/watchdog/advantechwdt.c
@@ -106,9 +106,9 @@ static int advwdt_set_heartbeat(int t)
* /dev/watchdog handling
*/
-static ssize_t advwdt_write(struct file *file, const char __user *buf,
- size_t count, loff_t *ppos)
+static ssize_t advwdt_write(struct kiocb *iocb, struct iov_iter *from)
{
+ size_t count = iov_iter_count(from);
if (count) {
if (!nowayout) {
size_t i;
@@ -117,7 +117,7 @@ static ssize_t advwdt_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')
adv_expect_close = 42;
@@ -218,7 +218,7 @@ static int advwdt_close(struct inode *inode, struct file *file)
static const struct file_operations advwdt_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
- .write = advwdt_write,
+ .write_iter = advwdt_write,
.unlocked_ioctl = advwdt_ioctl,
.compat_ioctl = compat_ptr_ioctl,
.open = advwdt_open,
--
2.43.0
Powered by blists - more mailing lists