linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] target/file: don't zero iter before iov_iter_bvec
@ 2021-01-09 15:53 Pavel Begunkov
  2021-01-09 20:09 ` Chaitanya Kulkarni
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Pavel Begunkov @ 2021-01-09 15:53 UTC (permalink / raw)
  To: Martin K . Petersen; +Cc: linux-scsi, target-devel, linux-kernel

iov_iter_bvec() initialises iterators well, no need to pre-zero it
beforehand as done in fd_execute_rw_aio(). Compilers can't optimise it
out and generate extra code for that (confirmed with assembly).

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 drivers/target/target_core_file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index cce455929778..5a66854def95 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -267,7 +267,7 @@ fd_execute_rw_aio(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
 	struct fd_dev *fd_dev = FD_DEV(dev);
 	struct file *file = fd_dev->fd_file;
 	struct target_core_file_cmd *aio_cmd;
-	struct iov_iter iter = {};
+	struct iov_iter iter;
 	struct scatterlist *sg;
 	ssize_t len = 0;
 	int ret = 0, i;
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-01-15  4:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-09 15:53 [PATCH] target/file: don't zero iter before iov_iter_bvec Pavel Begunkov
2021-01-09 20:09 ` Chaitanya Kulkarni
2021-01-09 20:37   ` Pavel Begunkov
2021-01-09 20:52     ` Chaitanya Kulkarni
2021-01-09 21:25       ` Pavel Begunkov
2021-01-11  2:06         ` Chaitanya Kulkarni
2021-01-11  2:28           ` Pavel Begunkov
2021-01-11  5:23             ` Chaitanya Kulkarni
2021-01-11  5:31               ` Pavel Begunkov
2021-01-11  2:49 ` Bart Van Assche
2021-01-13  5:34 ` Martin K. Petersen
2021-01-15  4:08 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).