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

Jens Axboe
2024-04-11T15:40:55Z

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,