Commit 73d7409c authored by David Howells's avatar David Howells Committed by Paolo Abeni

crypto: af_alg: Indent the loop in af_alg_sendmsg()

Put the loop in af_alg_sendmsg() into an if-statement to indent it to make
the next patch easier to review as that will add another branch to handle
MSG_SPLICE_PAGES to the if-statement.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
cc: Herbert Xu <herbert@gondor.apana.org.au>
cc: "David S. Miller" <davem@davemloft.net>
cc: Eric Dumazet <edumazet@google.com>
cc: Jakub Kicinski <kuba@kernel.org>
cc: Paolo Abeni <pabeni@redhat.com>
cc: Jens Axboe <axboe@kernel.dk>
cc: Matthew Wilcox <willy@infradead.org>
cc: linux-crypto@vger.kernel.org
cc: netdev@vger.kernel.org
Acked-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent c1abe6f5
...@@ -1030,6 +1030,7 @@ int af_alg_sendmsg(struct socket *sock, struct msghdr *msg, size_t size, ...@@ -1030,6 +1030,7 @@ int af_alg_sendmsg(struct socket *sock, struct msghdr *msg, size_t size,
if (sgl->cur) if (sgl->cur)
sg_unmark_end(sg + sgl->cur - 1); sg_unmark_end(sg + sgl->cur - 1);
if (1 /* TODO check MSG_SPLICE_PAGES */) {
do { do {
struct page *pg; struct page *pg;
unsigned int i = sgl->cur; unsigned int i = sgl->cur;
...@@ -1044,7 +1045,8 @@ int af_alg_sendmsg(struct socket *sock, struct msghdr *msg, size_t size, ...@@ -1044,7 +1045,8 @@ int af_alg_sendmsg(struct socket *sock, struct msghdr *msg, size_t size,
sg_assign_page(sg + i, pg); sg_assign_page(sg + i, pg);
err = memcpy_from_msg(page_address(sg_page(sg + i)), err = memcpy_from_msg(
page_address(sg_page(sg + i)),
msg, plen); msg, plen);
if (err) { if (err) {
__free_page(sg_page(sg + i)); __free_page(sg_page(sg + i));
...@@ -1059,6 +1061,7 @@ int af_alg_sendmsg(struct socket *sock, struct msghdr *msg, size_t size, ...@@ -1059,6 +1061,7 @@ int af_alg_sendmsg(struct socket *sock, struct msghdr *msg, size_t size,
size -= plen; size -= plen;
sgl->cur++; sgl->cur++;
} while (len && sgl->cur < MAX_SGL_ENTS); } while (len && sgl->cur < MAX_SGL_ENTS);
}
if (!size) if (!size)
sg_mark_end(sg + sgl->cur - 1); sg_mark_end(sg + sgl->cur - 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment