[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240411153126.16201-320-axboe@kernel.dk>
Date: Thu, 11 Apr 2024 09:17:39 -0600
From: Jens Axboe <axboe@...nel.dk>
To: linux-kernel@...r.kernel.org
Cc: Bui Quang Minh <minhquangbui99@...il.com>,
Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 319/437] drivers/net/ethernet/broadcom-bnxt: convert to read/write iterators
From: Bui Quang Minh <minhquangbui99@...il.com>
Signed-off-by: Bui Quang Minh <minhquangbui99@...il.com>
Signed-off-by: Jens Axboe <axboe@...nel.dk>
---
drivers/net/ethernet/broadcom/bnxt/bnxt_debugfs.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_debugfs.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_debugfs.c
index 156c2404854f..777f2e892869 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_debugfs.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_debugfs.c
@@ -17,15 +17,14 @@
static struct dentry *bnxt_debug_mnt;
-static ssize_t debugfs_dim_read(struct file *filep,
- char __user *buffer,
- size_t count, loff_t *ppos)
+static ssize_t debugfs_dim_read_iter(struct kiocb *iocb, struct iov_iter *to)
{
- struct dim *dim = filep->private_data;
+ struct dim *dim = iocb->ki_filp->private_data;
int len;
char *buf;
+ size_t count = iov_iter_count(to);
- if (*ppos)
+ if (iocb->ki_pos)
return 0;
if (!dim)
return -ENODEV;
@@ -50,7 +49,7 @@ static ssize_t debugfs_dim_read(struct file *filep,
kfree(buf);
return -ENOSPC;
}
- len = simple_read_from_buffer(buffer, count, ppos, buf, strlen(buf));
+ len = simple_copy_to_iter(buf, &iocb->ki_pos, strlen(buf), to);
kfree(buf);
return len;
}
@@ -58,7 +57,7 @@ static ssize_t debugfs_dim_read(struct file *filep,
static const struct file_operations debugfs_dim_fops = {
.owner = THIS_MODULE,
.open = simple_open,
- .read = debugfs_dim_read,
+ .read_iter = debugfs_dim_read_iter,
};
static void debugfs_dim_ring_init(struct dim *dim, int ring_idx,
--
2.43.0
Powered by blists - more mailing lists