use iov_iter_ubuf() instead of iov_iter_init() to simplify the code
Signed-off-by: Xianting Tian <[email protected]>
---
fs/seq_file.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/seq_file.c b/fs/seq_file.c
index 9456a2032224..6af66161576a 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -150,13 +150,12 @@ static int traverse(struct seq_file *m, loff_t offset)
*/
ssize_t seq_read(struct file *file, char __user *buf, size_t size, loff_t *ppos)
{
- struct iovec iov = { .iov_base = buf, .iov_len = size};
struct kiocb kiocb;
struct iov_iter iter;
ssize_t ret;
init_sync_kiocb(&kiocb, file);
- iov_iter_init(&iter, READ, &iov, 1, size);
+ iov_iter_ubuf(&iter, READ, buf, size);
kiocb.ki_pos = *ppos;
ret = seq_read_iter(&kiocb, &iter);
--
2.17.1