[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240411153126.16201-243-axboe@kernel.dk>
Date: Thu, 11 Apr 2024 09:16:22 -0600
From: Jens Axboe <axboe@...nel.dk>
To: linux-kernel@...r.kernel.org
Cc: Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 242/437] watchdog: ibmasr: convert to read/write iterators
Signed-off-by: Jens Axboe <axboe@...nel.dk>
---
drivers/watchdog/ibmasr.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/watchdog/ibmasr.c b/drivers/watchdog/ibmasr.c
index 6955c693b5fd..6f0931f33a6d 100644
--- a/drivers/watchdog/ibmasr.c
+++ b/drivers/watchdog/ibmasr.c
@@ -243,9 +243,9 @@ static int __init asr_get_base_address(void)
}
-static ssize_t asr_write(struct file *file, const char __user *buf,
- size_t count, loff_t *ppos)
+static ssize_t asr_write(struct kiocb *iocb, struct iov_iter *from)
{
+ size_t count = iov_iter_count(from);
if (count) {
if (!nowayout) {
size_t i;
@@ -255,7 +255,7 @@ static ssize_t asr_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')
asr_expect_close = 42;
@@ -341,7 +341,7 @@ static int asr_release(struct inode *inode, struct file *file)
static const struct file_operations asr_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
- .write = asr_write,
+ .write_iter = asr_write,
.unlocked_ioctl = asr_ioctl,
.compat_ioctl = compat_ptr_ioctl,
.open = asr_open,
--
2.43.0
Powered by blists - more mailing lists