diff options
author | J. Bruce Fields <bfields@redhat.com> | 2014-09-19 17:21:35 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2014-10-23 14:05:11 -0400 |
commit | ed38c0699848508672793bbdcca98ee89aa6c71e (patch) | |
tree | b0bc61cd7e8426030c41a71c7338d312950f6629 /net/sunrpc/xdr.c | |
parent | e77a7b4f01b4c7b02c1c15b5d5b4ce4bd147b043 (diff) |
RPC: remove unneeded checks from xdr_truncate_encode()
Thanks to Andrea Arcangeli for pointing out these checks are
obviously unnecessary given the preceding calculations.
Reported-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc/xdr.c')
-rw-r--r-- | net/sunrpc/xdr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c index 290af97bf6f9..bcece520c4db 100644 --- a/net/sunrpc/xdr.c +++ b/net/sunrpc/xdr.c | |||
@@ -617,7 +617,7 @@ void xdr_truncate_encode(struct xdr_stream *xdr, size_t len) | |||
617 | fraglen = min_t(int, buf->len - len, tail->iov_len); | 617 | fraglen = min_t(int, buf->len - len, tail->iov_len); |
618 | tail->iov_len -= fraglen; | 618 | tail->iov_len -= fraglen; |
619 | buf->len -= fraglen; | 619 | buf->len -= fraglen; |
620 | if (tail->iov_len && buf->len == len) { | 620 | if (tail->iov_len) { |
621 | xdr->p = tail->iov_base + tail->iov_len; | 621 | xdr->p = tail->iov_base + tail->iov_len; |
622 | /* xdr->end, xdr->iov should be set already */ | 622 | /* xdr->end, xdr->iov should be set already */ |
623 | return; | 623 | return; |
@@ -631,7 +631,7 @@ void xdr_truncate_encode(struct xdr_stream *xdr, size_t len) | |||
631 | old = new + fraglen; | 631 | old = new + fraglen; |
632 | xdr->page_ptr -= (old >> PAGE_SHIFT) - (new >> PAGE_SHIFT); | 632 | xdr->page_ptr -= (old >> PAGE_SHIFT) - (new >> PAGE_SHIFT); |
633 | 633 | ||
634 | if (buf->page_len && buf->len == len) { | 634 | if (buf->page_len) { |
635 | xdr->p = page_address(*xdr->page_ptr); | 635 | xdr->p = page_address(*xdr->page_ptr); |
636 | xdr->end = (void *)xdr->p + PAGE_SIZE; | 636 | xdr->end = (void *)xdr->p + PAGE_SIZE; |
637 | xdr->p = (void *)xdr->p + (new % PAGE_SIZE); | 637 | xdr->p = (void *)xdr->p + (new % PAGE_SIZE); |