Received: by 2002:ab2:7988:0:b0:1f4:b336:87c4 with SMTP id g8csp55287lqj; Thu, 11 Apr 2024 09:40:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXxJjT57BadH+v/ao8LjZ8CwK8ApI2W6nTqtkul7Cg0svQaioRo0/xQS/FqFjIimfgVPwd4J0mx9e7L7VKovzgY/m0WlRo6sg+GeIDjuw== X-Google-Smtp-Source: AGHT+IGzYWHPxzhfRMYgIfGxygsWl1OQW3D4fS8XX+ALCjcqjDmk9z5p8+bFV1OsdXTmP/AxG2Ma X-Received: by 2002:a05:6870:d148:b0:221:cb66:c36b with SMTP id f8-20020a056870d14800b00221cb66c36bmr52204oac.4.1712853610184; Thu, 11 Apr 2024 09:40:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712853610; cv=pass; d=google.com; s=arc-20160816; b=j1YYpJU6PnveeZxaTS0EqzWFqS0DV7EvUDfVaA3WGi/Na7OTFvkhQTWaBoBSEA0yAF VWsRx2jtI1n4Jd8eTuNJlGMuxMnmS99ow4GTDj0YSdRVyNihhybRVcDY1HdfmPSpK/G+ kMBBpm2R5wFB1Y3NDq0+0lY1LyJ6jzyc9RwS4HAFujWZlUghEe8L4N2RlQvbCLfZj/51 rI5pN8+oV3dbDmcviKnBfxOaUhsGspQ4q0YmRrwYGQyUgNu82Z2YL/VOlvUpdv0DdKf1 XgvyXPdbr0JRTkQputQH75+AYKiVnr4iUJupi3Ob0feFH/kjFTx3KmavqRA8srEz0+3R 1gBQ== 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=mscnvAodvFjnkULv9sqFuSpmTwvvYlqWrZMKP6DUYFM=; fh=2FInBIgEh7xt9W7JS1z2wQ7fUhvLHtwfAfkXluU3JoI=; b=ATbNtxwr8x9gwbgmpeCmtjK/I7YIAuAgIA8qFffkjakQHl3Ae7l+RAr3B0567F85BQ 6fCz3zfGu3Pea7Oqjhjj29QLoaF8xmC8TZOBWV6DkIIKKqzagWpxYXbMXCCaavU9eeJK j/sk2z8HkywAUDDmUjW0xSiwjC+Ie9V1rkxtH3k+v4xOefKioWy8s4Wzw+ziBYgEawvN 4oASrVBlKx40E6zGrHihMBz8OiqUyWv0qbDCj851oaZu04/OG9h8YtZXIYqUJ3RAVyzW OpVSApL2Q7iZgRXss2y66664nfhW8H9IG0m6Rj7Y+Uym5ih4xbckJ5Uxbf1PLJJhfUch S4Wg==; 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="Z/Dt6OQE"; 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-141036-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141036-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 h21-20020a05620a401500b0078bd5472148si2060363qko.56.2024.04.11.09.40.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 09:40:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-141036-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="Z/Dt6OQE"; 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-141036-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141036-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 D06111C22644 for ; Thu, 11 Apr 2024 16:40:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 01C451CD774; Thu, 11 Apr 2024 15:39:01 +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="Z/Dt6OQE" Received: from mail-il1-f178.google.com (mail-il1-f178.google.com [209.85.166.178]) (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 B1A9D1CCF12 for ; Thu, 11 Apr 2024 15:38:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712849940; cv=none; b=MTira5aS8n41ZpaaClIeXnOwE7nXE6MG1LTjjmYEZ5iAKYxUPxckcsXCoTBS0+hTrWT8jXNW5Q5csyPSgSDoQxShpJJF/pvXyg2LuY4cTLP+sNWC0J1FIcvOyep+G5y3HE9JJknMAOl495izCYWq56JKR796og/+qycbe1wpBSw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712849940; c=relaxed/simple; bh=PU1Zf+zrd7sTsTKINY0PwDd5tG03rzKZ5kv3h7QMxb4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Mup8ZZEzOa7Bv2c/3SKl8UjK+viQq0a+vunlulMFUWIAlwbbVj8zBlK7qJsQLJjnPWG7X2OZiCqzTmHTVjy9ILkOIGCONmTWqxm9S0nJ3TLXWuNj/FLw2KJwzVnxIX9WgEtFWNxePPZ335c5IQFo55CmqoRKLr6ioIedS8RYo5A= 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=Z/Dt6OQE; arc=none smtp.client-ip=209.85.166.178 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-f178.google.com with SMTP id e9e14a558f8ab-36a224d7414so188375ab.1 for ; Thu, 11 Apr 2024 08:38:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1712849937; x=1713454737; 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=mscnvAodvFjnkULv9sqFuSpmTwvvYlqWrZMKP6DUYFM=; b=Z/Dt6OQE046C1t2qAj0oEqPQBaU7MCZqIp6r1cKksPcdjrgtgCnC8sjBmo6dXOJblF wqNvm1Tk4CYIEHY7rEY1ICUoAoLpbIz1/51V1VRHqIEUBZEW8lg1oegDxNZfwSkpIcQU gqLud18TyPHVFHCX8bmWOKySKKYSujpLv43hju70b0pRz0mOdXDx0HxkC3nopj796U9f OupFgBCKPwsmPlvSueLQWDb/fusIklGXe0FeO2ndG3auB+NZY6+VIm/NhqcGQi2yDTO3 nm/pH12nq4dkuBYT99JsbK5Tg2fCZ1WpVWueIJDji15VhcSpNod8h+cyQ2VytUKicVWW 3hXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712849937; x=1713454737; 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=mscnvAodvFjnkULv9sqFuSpmTwvvYlqWrZMKP6DUYFM=; b=J4ZukF04dNjiPVTGXiv+E1yiR7YJ/+T5UtZ6NUv2Iu6ZKlrWarczIHnIhz9DvDDOv9 X6c5SttbXABRd+M9qW1ZPf9Q+dbPF34yvQjwJUrHvaPVbE+cNWkkRnAJjrnk4YGoAw8s vDOM+os32hn3CKuE/pQmuvXaWvtXhl9V3VZyt7uAu+wSQQEG/k04Ma7UgXAkdvUK+PWm 211RD5aO0U3kldqruxf8vGTXEUvoq4w6OKMH9M44dhypsg+vt2lNUPbZLb19poBaK4Wr 4OerwAEy4jamhM5WPOk8c8ylxaZLrFGHeaLDdiEAiXMXALGEmaTzQZ0CJiku00pYTSY2 39tA== X-Gm-Message-State: AOJu0YygqFGeS9ZZXqCGxy99HXxHN5NKFQIz3JJoo2TboHm8sjsTMSDn F8uKBNNt440TczckspuQkTkODHdkwxYhqDyyqmDCxBfBczxnpiQ6c14dm9K+SV/Yf/eZVxeQ+4s y X-Received: by 2002:a05:6602:4ed7:b0:7d5:ddc8:504d with SMTP id gk23-20020a0566024ed700b007d5ddc8504dmr194815iob.0.1712849937495; Thu, 11 Apr 2024 08:38:57 -0700 (PDT) Received: from localhost.localdomain ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id jc25-20020a056638891900b0047f14b7f6c0sm457056jab.5.2024.04.11.08.38.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 08:38:56 -0700 (PDT) From: Jens Axboe To: linux-kernel@vger.kernel.org Cc: Jens Axboe Subject: [PATCH 262/437] watchdog: watchdog_dev: convert to read/write iterators Date: Thu, 11 Apr 2024 09:16:42 -0600 Message-ID: <20240411153126.16201-263-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/watchdog_dev.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c index e2bd266b1b5b..828141d16264 100644 --- a/drivers/watchdog/watchdog_dev.c +++ b/drivers/watchdog/watchdog_dev.c @@ -694,10 +694,10 @@ static int watchdog_ioctl_op(struct watchdog_device *wdd, unsigned int cmd, * * Return: @len if successful, error otherwise. */ -static ssize_t watchdog_write(struct file *file, const char __user *data, - size_t len, loff_t *ppos) +static ssize_t watchdog_write(struct kiocb *iocb, struct iov_iter *from) { - struct watchdog_core_data *wd_data = file->private_data; + struct watchdog_core_data *wd_data = iocb->ki_filp->private_data; + size_t len = iov_iter_count(from); struct watchdog_device *wdd; int err; size_t i; @@ -714,7 +714,7 @@ static ssize_t watchdog_write(struct file *file, const char __user *data, /* scan to see whether or not we got the magic character */ for (i = 0; i != len; i++) { - if (get_user(c, data + i)) + if (get_iter(c, from)) return -EFAULT; if (c == 'V') set_bit(_WDOG_ALLOW_RELEASE, &wd_data->status); @@ -991,7 +991,7 @@ static int watchdog_release(struct inode *inode, struct file *file) static const struct file_operations watchdog_fops = { .owner = THIS_MODULE, - .write = watchdog_write, + .write_iter = watchdog_write, .unlocked_ioctl = watchdog_ioctl, .compat_ioctl = compat_ptr_ioctl, .open = watchdog_open, -- 2.43.0