[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240411153126.16201-234-axboe@kernel.dk>
Date: Thu, 11 Apr 2024 09:16:13 -0600
From: Jens Axboe <axboe@...nel.dk>
To: linux-kernel@...r.kernel.org
Cc: Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 233/437] watchdog: acquirewdt: convert to read/write iterators
Signed-off-by: Jens Axboe <axboe@...nel.dk>
---
drivers/watchdog/acquirewdt.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/watchdog/acquirewdt.c b/drivers/watchdog/acquirewdt.c
index 53b04abd55b0..cdc27fc68f4a 100644
--- a/drivers/watchdog/acquirewdt.c
+++ b/drivers/watchdog/acquirewdt.c
@@ -114,9 +114,9 @@ static void acq_stop(void)
* /dev/watchdog handling
*/
-static ssize_t acq_write(struct file *file, const char __user *buf,
- size_t count, loff_t *ppos)
+static ssize_t acq_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) {
@@ -128,7 +128,7 @@ static ssize_t acq_write(struct file *file, const char __user *buf,
magic character */
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;
@@ -219,7 +219,7 @@ static int acq_close(struct inode *inode, struct file *file)
static const struct file_operations acq_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
- .write = acq_write,
+ .write_iter = acq_write,
.unlocked_ioctl = acq_ioctl,
.compat_ioctl = compat_ptr_ioctl,
.open = acq_open,
--
2.43.0
Powered by blists - more mailing lists