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 247/437] watchdog: pc87413_wdt: convert to read/write iterators
    Date
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    ---
    drivers/watchdog/pc87413_wdt.c | 14 ++++++--------
    1 file changed, 6 insertions(+), 8 deletions(-)

    diff --git a/drivers/watchdog/pc87413_wdt.c b/drivers/watchdog/pc87413_wdt.c
    index c7f745caf203..7ccc5aa4bd25 100644
    --- a/drivers/watchdog/pc87413_wdt.c
    +++ b/drivers/watchdog/pc87413_wdt.c
    @@ -327,18 +327,16 @@ static int pc87413_status(void)

    /**
    * pc87413_write:
    - * @file: file handle to the watchdog
    - * @data: data buffer to write
    - * @len: length in bytes
    - * @ppos: pointer to the position to write. No seeks allowed
    + * @iocb: metadata for IO
    + * @from: data buffer to write
    *
    * A write to a watchdog device is defined as a keepalive signal. Any
    * write of data will do, as we we don't define content meaning.
    */

    -static ssize_t pc87413_write(struct file *file, const char __user *data,
    - size_t len, loff_t *ppos)
    +static ssize_t pc87413_write(struct kiocb *iocb, struct iov_iter *from)
    {
    + size_t len = iov_iter_count(from);
    /* See if we got the magic character 'V' and reload the timer */
    if (len) {
    if (!nowayout) {
    @@ -351,7 +349,7 @@ static ssize_t pc87413_write(struct file *file, const char __user *data,
    magic character */
    for (i = 0; i != len; i++) {
    char c;
    - if (get_user(c, data + i))
    + if (get_iter(c, from))
    return -EFAULT;
    if (c == 'V')
    expect_close = 42;
    @@ -471,7 +469,7 @@ static int pc87413_notify_sys(struct notifier_block *this,
    static const struct file_operations pc87413_fops = {
    .owner = THIS_MODULE,
    .llseek = no_llseek,
    - .write = pc87413_write,
    + .write_iter = pc87413_write,
    .unlocked_ioctl = pc87413_ioctl,
    .compat_ioctl = compat_ptr_ioctl,
    .open = pc87413_open,
    --
    2.43.0

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