Received: by 2002:ab2:7988:0:b0:1f4:b336:87c4 with SMTP id g8csp51434lqj; Thu, 11 Apr 2024 09:33:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVbE4Y2aZdj8gtXmBUqoFa2eqXPDuWDRgte1kF/jurD6/4q50nql20cGPtxlG0OP8g6uaMjesogVX4N7zNVD02EsznR9XXtDboQRHyVcQ== X-Google-Smtp-Source: AGHT+IHOyBF1X/QtwkBBHqUKGdkYv8WpZjtRbMct20pox1S3Vt/WWiG6H32CNCRYu3ZY5cewdU4h X-Received: by 2002:a05:6a00:22c2:b0:6ed:def7:6acb with SMTP id f2-20020a056a0022c200b006eddef76acbmr229652pfj.14.1712853237481; Thu, 11 Apr 2024 09:33:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712853237; cv=pass; d=google.com; s=arc-20160816; b=CutmzVG13+gniwt2RrbAXg0+XzbJovCFmDOoz2OwUDRkbuHFzKbLhla1Cl3CvrmDhh KEH1dnKhoRYzaqrtstqDnGBS65wAzYV08wyHio6PUoPuKWZLCCTWiBC1j0LqYZQQ2u5d 6r9b2J1+e5tT0KdTSWX4dPMqJynDh4KtuCBE7r/lrTbl3xy9BHnvfBLOd7U92dtCUxa3 qxerAu1+escSNa2cZMp9QDRZP0aZjfJoUsJBHMvtCcN3qIpCNN+rtodJPPdWFocuPdeR NJeBulV7ek7nf1Q6gSr5bJCs/oCNpIeEs7R/XlNnD0DA6ZpC1eGby9HBBlDy6Q1ANKug EmIQ== 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=9lLImXXFpvamki8Dp2j4GmpSOc49UTRYWPsz9Jb4zBA=; fh=2FInBIgEh7xt9W7JS1z2wQ7fUhvLHtwfAfkXluU3JoI=; b=ESSu+5ngi0IoG8V6Ic2wSEq3/ZM9kqTq5VqgXrTerm4j0utBkv8kkeqfQFNq9unqfe obvW1rFCpZEBzXZaF3hdYLZxjLDnguLjIvl2q1psI+vbYu72Z44x/1KjxPj4h94L6Yww 41kuZmZWmPST0NNAHc9xpUaoTtHNV9Z+ndMIEfUClrNlkbztnAbp6+dZ4hL3cOt8m//J iQtIqmaf0TaTyzgfCpQKY7K7F7fV9pw4j8bmQuCvAaw3DD/DMz3lv2c1MaVhtfEZu9nc e2Ie2ShnFSzaXcJ1rZCGy2shYqz/n3XGhO3zbjLwsdgBoKM2ARfJwta1Yya1az7bhs8N GsVw==; 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=PYrXGQJd; 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-141005-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141005-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id a19-20020aa78653000000b006ecfd012defsi1630029pfo.374.2024.04.11.09.33.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 09:33:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-141005-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=PYrXGQJd; 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-141005-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141005-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 796CC282295 for ; Thu, 11 Apr 2024 16:33:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D8BC11C42DF; Thu, 11 Apr 2024 15:38:12 +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="PYrXGQJd" Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) (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 CBF111C2FE5 for ; Thu, 11 Apr 2024 15:38:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712849892; cv=none; b=FIMhZkz12RGmLFD44sPdGaook1eY6HwtlcdQ3t8xPe3ThNXA4vpyeV9vDZjuJsPax/TfYaOdcdZTAZd/NgMtPa/Wc0Cb+kLZsD5AfgoI172v3Ax+0UTql5NEIryleGaHoIqU2ER7MFKnMWi1+/sULchDwM1W7h542Iw7AUfNKo0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712849892; c=relaxed/simple; bh=I008nlz7hMIwHwSINpFNSBgOki5AL1aXDldRxzQYz70=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lBzC59Yrm+s9pr/MtkEJqkXLxFlRgf5vn6UzyLTL2xugO04Uj2d1hKqirzrjKKzZRobKVzKvYTVq9+3E2teldP8ZWgLVuCAE4UwwPgvVvPoDu50S0IbmKoTvP/iBCIjxcP0ncXrBXSlt1NdDOTlVmOBxmuQoqQ2Uwt1gHHtCYRA= 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=PYrXGQJd; arc=none smtp.client-ip=209.85.166.48 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-io1-f48.google.com with SMTP id ca18e2360f4ac-7d6112ba6baso58122039f.1 for ; Thu, 11 Apr 2024 08:38:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1712849889; x=1713454689; 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=9lLImXXFpvamki8Dp2j4GmpSOc49UTRYWPsz9Jb4zBA=; b=PYrXGQJdgrOoRVuTwoAQ/lBvmnxSAK+f8fE/QI9CN+T1pDSCofaIXEBSRbVEqeGL6N dzo9g8n3ylxr4rDWvIT56SYVHNrBiNIOp9FygZFxfDJocrLmgly8N5KMzcRDmLSqEZ6F 1m7MXWq9oAu6ZooAge9d7HqCWfjZ/NKlLMwpCrqt3CVzoc/shDZ3r8EEwv3ZfY4lsYVa wHjnrNRQol+I1DEYluSVdjQ4lPrP+hAjo8CO7TPFclypODGrXJTgU3CyR8skozO2zcXZ 2SPIJVIhbqadTfJGgs6WrqpIOLeG7kfCUX0CxeeHLv3wwdqsrTKc1fInkLEibtXG/lcr ymBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712849889; x=1713454689; 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=9lLImXXFpvamki8Dp2j4GmpSOc49UTRYWPsz9Jb4zBA=; b=oqDy6TYH5d+RrVTPOIyWeRSSHdV6ocWl0Aw+eSNTo/M73o1P87b4P5ET99uJ7FPgWq uvWt2VTD0FiNSkKQCpJr5BG/Uvxz7BYMa9xx8H2pB0t6xDAcmdu1iQ8V/op2TzBPHUJP BM9MNumh4WhdGAV09+HtNMzI6jBVgKieI4k3w4f7GTqYrsCs0HRxaUXITwei9yIQ8SYe 1v31xlHsNqGyEWNIc6d4EdtIwMGBjKDfN3cFMktQC7oallK43bM7mp+p702rwMciI6yO jdAlRZEqJJUV2X1jdHvxqlmmibVUlH+JOrtwWCnOepKq7Dn1k+SplNjrMsI//NvBQO2W F6GQ== X-Gm-Message-State: AOJu0YyPXKaKgBGFJ//kKZoKXQQMZ1XkhaDGoLkKuThTZqsnrYKAkwI/ ycijUUof3oe3QqsW+d/Nup47WJv9muwfH4/EROG08ZI6gD1jjEsjoCA/4UPx5EJe5fRWGqhzNuQ h X-Received: by 2002:a6b:cd08:0:b0:7d5:fe3e:90ff with SMTP id d8-20020a6bcd08000000b007d5fe3e90ffmr207124iog.0.1712849889399; Thu, 11 Apr 2024 08:38:09 -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.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 08:38:07 -0700 (PDT) From: Jens Axboe To: linux-kernel@vger.kernel.org Cc: Jens Axboe Subject: [PATCH 233/437] watchdog: acquirewdt: convert to read/write iterators Date: Thu, 11 Apr 2024 09:16:13 -0600 Message-ID: <20240411153126.16201-234-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/acquirewdt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/acquirewdt.c b/drivers/watchdog/acquirewdt.c index 53b04abd55b0..cdc27fc68f4a 100644 --- a/drivers/watchdog/acquirewdt.c +++ b/drivers/watchdog/acquirewdt.c @@ -114,9 +114,9 @@ static void acq_stop(void) * /dev/watchdog handling */ -static ssize_t acq_write(struct file *file, const char __user *buf, - size_t count, loff_t *ppos) +static ssize_t acq_write(struct kiocb *iocb, struct iov_iter *from) { + size_t count = iov_iter_count(from); /* See if we got the magic character 'V' and reload the timer */ if (count) { if (!nowayout) { @@ -128,7 +128,7 @@ static ssize_t acq_write(struct file *file, const char __user *buf, magic character */ 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; @@ -219,7 +219,7 @@ static int acq_close(struct inode *inode, struct file *file) static const struct file_operations acq_fops = { .owner = THIS_MODULE, .llseek = no_llseek, - .write = acq_write, + .write_iter = acq_write, .unlocked_ioctl = acq_ioctl, .compat_ioctl = compat_ptr_ioctl, .open = acq_open, -- 2.43.0