Received: by 2002:ab2:7988:0:b0:1f4:b336:87c4 with SMTP id g8csp70813lqj; Thu, 11 Apr 2024 10:04:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU5+g5DM8kL3qEdB3gYPnPyyBvt3ZdS6VkOpZG8bya8EJd5RyMnZLUfcajs7ZGLwXY6Jk/Evu/hvtOrpK/o0lqxza/Z0PTCXgniq9V3Lg== X-Google-Smtp-Source: AGHT+IFW9EbbLdEf7WFwao6lgpsMH1ldEXjpgkb1iaJfB0fYoSZXHraW+AF0vrHf++/64VVkzdY4 X-Received: by 2002:a05:6512:1243:b0:516:b148:6d6 with SMTP id fb3-20020a056512124300b00516b14806d6mr289979lfb.50.1712855091558; Thu, 11 Apr 2024 10:04:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712855091; cv=pass; d=google.com; s=arc-20160816; b=pGyFsiUwOWZIkZmhufjSP1v4VoPE2KS1kG0+Jd7+EY5+0OuBwyNzItBBvY1i9ADhFj Zlme8ajfv9J9KgqLXYvOYAfnqNQpRcbtmKrV5h9n/uH2XEJvxW9PXXHCCFgCgcm94ktN o+WlgQlZXZBM1Hu1FZzHzxJNBtc4v0Q9HaovNCewOmNvM7TrzN5EHPo/UHu9kU8U8vYt tWQwXXBiiJxL47fN4j8mFny8ELk/O2t3qvLtTMfrpUpuSpSePlHXCbidxmq4UJxTtDwa CXz88PBzr8N5r9E8W43F6t4ir1m4tn49pUwo2ydlIU/7dZ086XsZ1zsDkMosm31AiZ+N L72w== 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=DFfR7rnk37eY+kj40RhuQFhYiRlfBiirVwlFZTavQ+w=; fh=2FInBIgEh7xt9W7JS1z2wQ7fUhvLHtwfAfkXluU3JoI=; b=lA7OYKtBhfjOlTGKLVn9E/nF9PCWBJ87Lmf3dU0mLMs/w5aNbL8JMFfT7W+ItA1cH9 085lM9k47ALtrP0OBpcFO7oOIT8fgLbbqrDyiu1i5ObJpqHQgn9bytdRUF5n73tdBWZN ClVETIe+eNMhEkS5JyliDiCqEfzwLj4NqWJVj4W/UD450jpMpl+rqEKDgE2qXLxKx9s7 6pVEG94cWDeH4xpI3PdIFRxXwQ9kKbujP/C6Vp+ny4kJTVW7Od1pZmNtVJe1/UMssjDe xlZdd0WbgVrEP/o4sp+qV7mR9JuF8vk7wWveSizNEWnVuGpJgY4ex7NHejPotyXDgd+6 wOvg==; 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=1VdAh08G; 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-141149-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141149-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id h28-20020a50cddc000000b0056e2c60123esi910766edj.26.2024.04.11.10.04.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 10:04:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-141149-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=1VdAh08G; 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-141149-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141149-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 103011F20DD3 for ; Thu, 11 Apr 2024 17:04:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CE2CE1F01BC; Thu, 11 Apr 2024 15:42:03 +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="1VdAh08G" Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) (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 AC0EF1EF53C for ; Thu, 11 Apr 2024 15:42:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712850123; cv=none; b=fQDTjOi4qQTbNAHD3to+vaDzLzqz04+dAZlALfZpE+zA56BmaX1sm+pX57KiO6Q6WE9lUs0cRSBAtosjInIhakTSddwgOL3mxS17s+h8hcOn12Et4d8Kq6F/FEHhl8rVHC4BV/K0r7yLj+vtRpqBYaEX1gM0Be1vU3aVIf/FWHo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712850123; c=relaxed/simple; bh=iRh49+5OkxCbqpZ3XI8G42DxgL1Hmu+w12M8sdxKXlk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ODnZpD1oFbs7QZa7v5bcc5heWY1TSk5kISCRCdfFwdEbpLcsXZXbnLBdTqShRSQUgVJrgjYysMcdWYCPPIdLG81Y5HWPGR/4fwwDY2EYS+5veJyvPrLiHswBvl2Nqy55LchIGoyAR3rm5/u8nKk+JjFcYma6ctZzKUfVesW/7I0= 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=1VdAh08G; arc=none smtp.client-ip=209.85.166.51 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-f51.google.com with SMTP id ca18e2360f4ac-7d6812b37a6so9086639f.0 for ; Thu, 11 Apr 2024 08:42:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1712850120; x=1713454920; 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=DFfR7rnk37eY+kj40RhuQFhYiRlfBiirVwlFZTavQ+w=; b=1VdAh08Gn5IoeaFgRBpBaHGinv6l0YgH7oSquQr5YE/3Gl7XKtCqkV/sv+qgO6ENM1 MyKLS4rx8kU3Kt3kSrND5sIT6T2UKx+kvC5Cs1B4tyiALF3jxUsgnXfVXwO3781z8OeW r3kUplr92pGXcyWGA4RUowqtD4Z6EgcTaevdwNFQ9RajCqck8727SYElasZetCDrgakl uGRUWqTfm/xpCLYqbVy0jmyUsULohizcmdIPD4V1cFcL8gUhtnGASNF8nE1iZRR0nR7k zB7Y05/4LRLIg0mmEJvykecooVjJ0ljDfkx1Lvu/28APcZ19Q5BtnYC8nm5P24FoVdde IzmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712850120; x=1713454920; 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=DFfR7rnk37eY+kj40RhuQFhYiRlfBiirVwlFZTavQ+w=; b=pqFTrCWenEzlE0YnLLFsLlBNAkCMC03CSdL6bHsm+NywHObqbauTfcHdYWjEs8Vip4 yofkGhbcjw/XJEaSEPqO5hQRPGXetonbQ/wKBkkkuGpLIcFqVMIZ+w56Z414BhA3Kddj nGcDC0LiBUNnIZNREBack5Kss6uY0yFK+REauLUYa5BoOxQ7WWTTWE8cw+3uxiPeJ4Jm S9vhOBR53zBAwGOCLE6RKxWniBhq80UL13QMNln3j0SsdbvxW5HH90RHkXMMqANG4Yvf 0Yu1PsvSr6M2fA1o9rt5xO1npmnH4nkDS4jgn+HtYkRbGDvEb32MKPdKFF2Cvnsemp9/ nlUQ== X-Gm-Message-State: AOJu0YweMB3wAFrfMU6oYFCvj7SMzUaeYCL03k059nO7hkhe+JDOddF/ Q9Q1dYqUbIfQeAulbqB16OXC6sDE4UJHk36QKPkxCGRCI/4uMkvz6DMiVnfiZmKAHxYAc++bN33 6 X-Received: by 2002:a5e:9907:0:b0:7d6:751f:192 with SMTP id t7-20020a5e9907000000b007d6751f0192mr196484ioj.2.1712850119657; Thu, 11 Apr 2024 08:41:59 -0700 (PDT) Received: from localhost.localdomain ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id jc25-20020a056638891900b0047f14b7f6c0sm457056jab.5.2024.04.11.08.41.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 08:41:58 -0700 (PDT) From: Jens Axboe To: linux-kernel@vger.kernel.org Cc: Jens Axboe Subject: [PATCH 368/437] hwmon: pt5161l: convert to read/write iterators Date: Thu, 11 Apr 2024 09:18:28 -0600 Message-ID: <20240411153126.16201-369-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/hwmon/pt5161l.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/drivers/hwmon/pt5161l.c b/drivers/hwmon/pt5161l.c index 60361e39c474..90cb27822ac0 100644 --- a/drivers/hwmon/pt5161l.c +++ b/drivers/hwmon/pt5161l.c @@ -493,10 +493,10 @@ static const struct hwmon_chip_info pt5161l_chip_info = { .info = pt5161l_info, }; -static ssize_t pt5161l_debugfs_read_fw_ver(struct file *file, char __user *buf, - size_t count, loff_t *ppos) +static ssize_t pt5161l_debugfs_read_fw_ver(struct kiocb *iocb, + struct iov_iter *to) { - struct pt5161l_data *data = file->private_data; + struct pt5161l_data *data = iocb->ki_filp->private_data; int ret; char ver[32]; @@ -509,19 +509,18 @@ static ssize_t pt5161l_debugfs_read_fw_ver(struct file *file, char __user *buf, ret = snprintf(ver, sizeof(ver), "%u.%u.%u\n", data->fw_ver.major, data->fw_ver.minor, data->fw_ver.build); - return simple_read_from_buffer(buf, count, ppos, ver, ret); + return simple_copy_to_iter(ver, &iocb->ki_pos, ret, to); } static const struct file_operations pt5161l_debugfs_ops_fw_ver = { - .read = pt5161l_debugfs_read_fw_ver, + .read_iter = pt5161l_debugfs_read_fw_ver, .open = simple_open, }; -static ssize_t pt5161l_debugfs_read_fw_load_sts(struct file *file, - char __user *buf, size_t count, - loff_t *ppos) +static ssize_t pt5161l_debugfs_read_fw_load_sts(struct kiocb *iocb, + struct iov_iter *to) { - struct pt5161l_data *data = file->private_data; + struct pt5161l_data *data = iocb->ki_filp->private_data; int ret; bool status = false; char health[16]; @@ -535,18 +534,18 @@ static ssize_t pt5161l_debugfs_read_fw_load_sts(struct file *file, ret = snprintf(health, sizeof(health), "%s\n", status ? "normal" : "abnormal"); - return simple_read_from_buffer(buf, count, ppos, health, ret); + return simple_copy_to_iter(health, &iocb->ki_pos, ret, to); } static const struct file_operations pt5161l_debugfs_ops_fw_load_sts = { - .read = pt5161l_debugfs_read_fw_load_sts, + .read_iter = pt5161l_debugfs_read_fw_load_sts, .open = simple_open, }; -static ssize_t pt5161l_debugfs_read_hb_sts(struct file *file, char __user *buf, - size_t count, loff_t *ppos) +static ssize_t pt5161l_debugfs_read_hb_sts(struct kiocb *iocb, + struct iov_iter *to) { - struct pt5161l_data *data = file->private_data; + struct pt5161l_data *data = iocb->ki_filp->private_data; int ret; bool status = false; char health[16]; @@ -560,11 +559,11 @@ static ssize_t pt5161l_debugfs_read_hb_sts(struct file *file, char __user *buf, ret = snprintf(health, sizeof(health), "%s\n", status ? "normal" : "abnormal"); - return simple_read_from_buffer(buf, count, ppos, health, ret); + return simple_copy_to_iter(health, &iocb->ki_pos, ret, to); } static const struct file_operations pt5161l_debugfs_ops_hb_sts = { - .read = pt5161l_debugfs_read_hb_sts, + .read_iter = pt5161l_debugfs_read_hb_sts, .open = simple_open, }; -- 2.43.0