Received: by 2002:ab2:7988:0:b0:1f4:b336:87c4 with SMTP id g8csp56661lqj; Thu, 11 Apr 2024 09:42:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVVtjeI/tZ/yyQGfGxupLQWJgTzfr/04IgH+7YgnRBs0PeWQMbx3/MdU1k0lrQzGUXhe2dhCq3Bvicj4czUAvnRxk9lxHwtXVDpdpeDVw== X-Google-Smtp-Source: AGHT+IH2AbrpNAUBThSDETCN9YlPYque0DzlYhzyUe3ZkbY6Djt+C7Qz7uIOAVLpnZge6Ey9oi97 X-Received: by 2002:ac8:58c1:0:b0:432:ebb2:2ea3 with SMTP id u1-20020ac858c1000000b00432ebb22ea3mr242773qta.28.1712853739850; Thu, 11 Apr 2024 09:42:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712853739; cv=pass; d=google.com; s=arc-20160816; b=xwBdf+iluZbe0yyMQQ8asuum2IvN4H1X9qpWg2IMcmuPyPV9JTERmIk0+Na2CHf7k1 FLxqfHQnx81uUOoiHWpvPfCVtK+pEWMQW85mAjx4+UHtdrL9gUzSwIA4z2J2rxPb1UV8 GqbPRpixEtuYA82slV79jDRg4B8oTvGy6fJPZ1BoOlPqpLggrz8QaQn0ozw1LxEvV8f6 nqCHp+wfjZRh9uNWLHMkMB9UrhliSULkmJDJMYfKT8iahNBoY+qQnyWS/dhOKVAlsqeo rHq4GaaQyTHYwTnFLsoTsSaN9XJOoN27r2TzvNN055avAy2N12XZhTo+Zw8H7qPmUf1A pa9Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=566s8Y6cLJziK/Nzw7hAPOYHoC3UrD4uE/BWUdAvK+8=; fh=2FInBIgEh7xt9W7JS1z2wQ7fUhvLHtwfAfkXluU3JoI=; b=Xu8Q8lYrk5vz5J+pSMAmDLvu2yr8+5DZYA/Mtx1smOaQeY+9oZaZbLWvxH3Dh6C0zp 8jkbfaxmTBjU9DKeE5Rbc5CEJPzu5k0P7v21hyQMEINjQzSyMyaAI+aUoTpWgh4dnIlS JgsP8zGf5x0zEHFiNhkhKzH03PArv4IhDtfY5XXfkxmLFkoWKNVMpekKvYaE1C7GNSOy wxIOFU1ZlHs6FvkSw8BspiyoCYX6pIHa+CWlpxL8Zoy9WlIUumAUROzs6suW722hcQjJ vfOQlWa70h1kVNY01YDMTJvBLwNAOAlvqmYwb2Kb7JkFChf3/ut9mOxIxz1uXwGBahFG bHvQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=lFUG+lNB; arc=pass (i=1 spf=pass spfdomain=kernel.dk dkim=pass dkdomain=kernel-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-141046-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141046-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id g17-20020ac85811000000b00434c4dba61csi1833132qtg.684.2024.04.11.09.42.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 09:42:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-141046-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=lFUG+lNB; arc=pass (i=1 spf=pass spfdomain=kernel.dk dkim=pass dkdomain=kernel-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-141046-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141046-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 7808D1C222DA for ; Thu, 11 Apr 2024 16:42:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C90A046436; Thu, 11 Apr 2024 15:39:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b="lFUG+lNB" Received: from mail-il1-f169.google.com (mail-il1-f169.google.com [209.85.166.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ADFB8154852 for ; Thu, 11 Apr 2024 15:39:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712849955; cv=none; b=jrNSxUXDtfWRrbNGbJ96INWnNNyezcqPqXf6Wr3VGtOatnQzdii0uuSFc5V1ZwSV8Z61TwkugHYumz3DBVTHiFxx1NTfDKCAuNP5cXCmI64Z5J8BeTJyWU/FXJuVHH70KXd2sGx1AZvIDSf1YElscRBDt5hcR93bhYAaAQ2ABy4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712849955; c=relaxed/simple; bh=/wkwY1Z44nmGszAk6jmCpjniCVU8/egqz5fntl8fqhY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TTcD4JvGlfoQ2J1lBVWutBUaUh1+fCzi9BiLksi0bg1EegSE0QqvjsBdm4ddLenBqcFhXzJlfR5u6o1iULzxJ0l7pzgr1WyXny3MfRwTbeBmeMlRxsoJkcOEnLBWcdcz293aM4vENMVtJpqAkYEwt+KE99f+Wg7VyEuo502wm6I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk; spf=pass smtp.mailfrom=kernel.dk; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b=lFUG+lNB; arc=none smtp.client-ip=209.85.166.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.dk Received: by mail-il1-f169.google.com with SMTP id e9e14a558f8ab-36a224d7414so188915ab.1 for ; Thu, 11 Apr 2024 08:39:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1712849952; x=1713454752; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=566s8Y6cLJziK/Nzw7hAPOYHoC3UrD4uE/BWUdAvK+8=; b=lFUG+lNBXW38KhuzC+vI6/hPIUnjJLnDwpvHDkECCJi4EmJa1z/qP2LWXVchyacfKA twiG5eC8KWMG72stUL5X27bI38G2ZhoLN1J2TEu8rRPJPpyd8JV4cb0vl1ZaUoCyLShc XFQid4QlywxG3Rw0R340NVyEPR4i+f0u4RyoDrQdd28WpZwqwjI4l+SiWYVk2s8YbEWT aKawANF1HvnW1+yPEftaDV/i7wTBCpJ0Khr75WtygPbuyUBxI1op2ELxiwVg+WOkeSfk kqsnBl2LGvwlX/8SQGbb/+xUdeGMZ7287vTxV8FDdhiUfbniJJh0JJZdnEXUZWw5NMEE n1tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712849952; x=1713454752; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=566s8Y6cLJziK/Nzw7hAPOYHoC3UrD4uE/BWUdAvK+8=; b=M4hGNEYTQr7ewqDN56qGYC3Ur+leWjw8bqR4kSD53o5yDSnP5EjSvmCQ4Lpaj2AbNo vBkJ6luHUqc1lK3pOK8Xbg/17LqWCx7pnH7TK1qfeVc+jalFXQcbiOa/sHbyBRzgN9Cj 13nfnVMq2QDQOR4+BLJqE4LXqmOybBT8n/m5GN5ZvjVk9pM13tw70HoDMtRT73tO5clO vyVHNuzLc6tnCMlVCl3IA4b2eHgg6ZDaHTLuI5cJT8P+/Cs9QMC4/bGmGIJe4BNLnE35 Y/KZGOFwx7BaQ0VrM6Ylqb1oDD56mOm2LOGAa4d420bhh2ler1NfYH2RBuK10XMWRFWR P49w== X-Gm-Message-State: AOJu0YxAqQM6aaK8gRp5a3/rFuypGYRJQ7EOjyY5rC1xfwAi5Ql0Fet7 pZAm/UTg9TZR7F6kQHkPlE+P7DQ2QrEPsHeQi7JCYicnBLeCVq356P18J+kmRd6/vaFmf5qRMwk j X-Received: by 2002:a6b:6605:0:b0:7d4:1dae:da1a with SMTP id a5-20020a6b6605000000b007d41daeda1amr156141ioc.2.1712849952559; Thu, 11 Apr 2024 08:39:12 -0700 (PDT) Received: from localhost.localdomain ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id jc25-20020a056638891900b0047f14b7f6c0sm457056jab.5.2024.04.11.08.39.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 08:39:11 -0700 (PDT) From: Jens Axboe To: linux-kernel@vger.kernel.org Cc: Jens Axboe Subject: [PATCH 272/437] watchdog: pika_wdt: convert to read/write iterators Date: Thu, 11 Apr 2024 09:16:52 -0600 Message-ID: <20240411153126.16201-273-axboe@kernel.dk> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240411153126.16201-1-axboe@kernel.dk> References: <20240411153126.16201-1-axboe@kernel.dk> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Signed-off-by: Jens Axboe --- drivers/watchdog/pika_wdt.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/pika_wdt.c b/drivers/watchdog/pika_wdt.c index 782b8c23d99c..bf1ac356df69 100644 --- a/drivers/watchdog/pika_wdt.c +++ b/drivers/watchdog/pika_wdt.c @@ -139,9 +139,10 @@ static int pikawdt_release(struct inode *inode, struct file *file) /* * Pat the watchdog whenever device is written to. */ -static ssize_t pikawdt_write(struct file *file, const char __user *data, - size_t len, loff_t *ppos) +static ssize_t pikawdt_write(struct kiocb *iocb, struct iov_iter *from) { + size_t len = iov_iter_count(from); + if (!len) return 0; @@ -153,7 +154,7 @@ static ssize_t pikawdt_write(struct file *file, const char __user *data, for (i = 0; i < len; i++) { char c; - if (get_user(c, data + i)) + if (get_iter(c, from)) return -EFAULT; if (c == 'V') { pikawdt_private.expect_close = 42; @@ -212,7 +213,7 @@ static const struct file_operations pikawdt_fops = { .llseek = no_llseek, .open = pikawdt_open, .release = pikawdt_release, - .write = pikawdt_write, + .write_iter = pikawdt_write, .unlocked_ioctl = pikawdt_ioctl, .compat_ioctl = compat_ptr_ioctl, }; -- 2.43.0