Skip to content

Commit 90d871b

Browse files
committed
SUNRPC: Clean up xdr_commit_encode()
Both the kvec::iov_len field and the third parameter of memcpy() and memmove() are size_t. There's no reason for the implicit conversion from size_t to int and back. Change the type of @shift to make the code easier to read and understand. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Reviewed-by: NeilBrown <neilb@suse.de> Reviewed-by: J. Bruce Fields <bfields@fieldses.org>
1 parent 62ed448 commit 90d871b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/sunrpc/xdr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ EXPORT_SYMBOL_GPL(xdr_init_encode);
933933
*/
934934
void __xdr_commit_encode(struct xdr_stream *xdr)
935935
{
936-
int shift = xdr->scratch.iov_len;
936+
size_t shift = xdr->scratch.iov_len;
937937
void *page;
938938

939939
page = page_address(*xdr->page_ptr);

0 commit comments

Comments
 (0)