Skip to content

Commit

Permalink
sunrpc: clean up xdr_shrink_pagelen use of temporary pointer
Browse files Browse the repository at this point in the history
char *p is used only as a shorthand for tail->iov_base + len in a nested
block.  Move it there.

Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Benny Halevy authored and Trond Myklebust committed Aug 29, 2010
1 parent b1a7a91 commit 0fe62a3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/sunrpc/xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,16 +395,15 @@ xdr_shrink_pagelen(struct xdr_buf *buf, size_t len)
{
struct kvec *tail;
size_t copy;
char *p;
unsigned int pglen = buf->page_len;

tail = buf->tail;
BUG_ON (len > pglen);

/* Shift the tail first */
if (tail->iov_len != 0) {
p = (char *)tail->iov_base + len;
if (tail->iov_len > len) {
char *p = (char *)tail->iov_base + len;
copy = tail->iov_len - len;
memmove(p, tail->iov_base, copy);
}
Expand Down

0 comments on commit 0fe62a3

Please sign in to comment.