[PATCH 333/437] arch/arm: convert to read/write iterators

From: Jens Axboe
Date: Thu Apr 11 2024 - 13:04:42 EST


Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
---
arch/arm/common/bL_switcher_dummy_if.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/common/bL_switcher_dummy_if.c b/arch/arm/common/bL_switcher_dummy_if.c
index cabc0659b329..f9794c4a6a40 100644
--- a/arch/arm/common/bL_switcher_dummy_if.c
+++ b/arch/arm/common/bL_switcher_dummy_if.c
@@ -15,9 +15,9 @@
#include <linux/uaccess.h>
#include <asm/bL_switcher.h>

-static ssize_t bL_switcher_write(struct file *file, const char __user *buf,
- size_t len, loff_t *pos)
+static ssize_t bL_switcher_write(struct kiocb *iocb, struct iov_iter *from)
{
+ size_t len = iov_iter_count(from);
unsigned char val[3];
unsigned int cpu, cluster;
int ret;
@@ -27,7 +27,7 @@ static ssize_t bL_switcher_write(struct file *file, const char __user *buf,
if (len < 3)
return -EINVAL;

- if (copy_from_user(val, buf, 3))
+ if (!copy_from_iter_full(val, 3, fro))
return -EFAULT;

/* format: <cpu#>,<cluster#> */
@@ -44,7 +44,7 @@ static ssize_t bL_switcher_write(struct file *file, const char __user *buf,
}

static const struct file_operations bL_switcher_fops = {
- .write = bL_switcher_write,
+ .write_iter = bL_switcher_write,
.owner = THIS_MODULE,
};

--
2.43.0