summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2021-04-29 02:59:08 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2021-06-10 17:45:15 +0200
commitf5da83545f4ed2c1a1648b7d760a6fc358798e52 (patch)
tree9a2f903521c3810a7f3a159e3d3e534ba60f45c3 /lib
parentcsum_and_copy_to_iter(): massage into form closer to csum_and_copy_from_iter() (diff)
downloadlinux-f5da83545f4ed2c1a1648b7d760a6fc358798e52.tar.xz
linux-f5da83545f4ed2c1a1648b7d760a6fc358798e52.zip
iterate_and_advance(): get rid of magic in case when n is 0
iov_iter_advance() needs to do some non-trivial work when it's given 0 as argument (skip all empty iovecs, mostly). We used to implement it via iterate_and_advance(); we no longer do so and for all other users of iterate_and_advance() zero length is a no-op. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'lib')
-rw-r--r--lib/iov_iter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/iov_iter.c b/lib/iov_iter.c
index 93ae0c2c8d66..763114a754c5 100644
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -117,7 +117,7 @@
#define iterate_and_advance(i, n, v, I, B, K, X) { \
if (unlikely(i->count < n)) \
n = i->count; \
- if (i->count) { \
+ if (likely(n)) { \
size_t skip = i->iov_offset; \
if (likely(iter_is_iovec(i))) { \
const struct iovec *iov; \