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 359/437] hwmon: w83793: convert to read/write iterators
    Date
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    ---
    drivers/hwmon/w83793.c | 10 +++++-----
    1 file changed, 5 insertions(+), 5 deletions(-)

    diff --git a/drivers/hwmon/w83793.c b/drivers/hwmon/w83793.c
    index 96bab94ba899..7594fc588112 100644
    --- a/drivers/hwmon/w83793.c
    +++ b/drivers/hwmon/w83793.c
    @@ -1352,11 +1352,11 @@ static int watchdog_close(struct inode *inode, struct file *filp)
    return 0;
    }

    -static ssize_t watchdog_write(struct file *filp, const char __user *buf,
    - size_t count, loff_t *offset)
    +static ssize_t watchdog_write(struct kiocb *iocb, struct iov_iter *from)
    {
    ssize_t ret;
    - struct w83793_data *data = filp->private_data;
    + struct w83793_data *data = iocb->ki_filp->private_data;
    + size_t count = iov_iter_count(from);

    if (count) {
    if (!nowayout) {
    @@ -1367,7 +1367,7 @@ static ssize_t watchdog_write(struct file *filp, 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')
    data->watchdog_expect_close = 1;
    @@ -1454,7 +1454,7 @@ static const struct file_operations watchdog_fops = {
    .llseek = no_llseek,
    .open = watchdog_open,
    .release = watchdog_close,
    - .write = watchdog_write,
    + .write_iter = watchdog_write,
    .unlocked_ioctl = watchdog_ioctl,
    .compat_ioctl = compat_ptr_ioctl,
    };
    --
    2.43.0

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