lkml.org 
[lkml]   [2024]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 277/437] watchdog: sbc8360: convert to read/write iterators
Date
Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
drivers/watchdog/sbc8360.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/watchdog/sbc8360.c b/drivers/watchdog/sbc8360.c
index 4f8b9912fc51..5d7042c85988 100644
--- a/drivers/watchdog/sbc8360.c
+++ b/drivers/watchdog/sbc8360.c
@@ -234,9 +234,10 @@ static void sbc8360_stop(void)
}

/* Userspace pings kernel driver, or requests clean close */
-static ssize_t sbc8360_write(struct file *file, const char __user *buf,
- size_t count, loff_t *ppos)
+static ssize_t sbc8360_write(struct kiocb *iocb, struct iov_iter *from)
{
+ size_t count = iov_iter_count(from);
+
if (count) {
if (!nowayout) {
size_t i;
@@ -246,7 +247,7 @@ static ssize_t sbc8360_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;
@@ -302,7 +303,7 @@ static int sbc8360_notify_sys(struct notifier_block *this, unsigned long code,
static const struct file_operations sbc8360_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
- .write = sbc8360_write,
+ .write_iter = sbc8360_write,
.open = sbc8360_open,
.release = sbc8360_close,
};
--
2.43.0

\
 
 \ /
  Last update: 2024-05-27 16:36    [W:2.588 / U:1.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site