Commit 56edc86b authored by Jeff Layton's avatar Jeff Layton Committed by J. Bruce Fields

nfsd: fix compiler warning about ambiguous types in nfsd_cache_csum

kbuild test robot says:

tree:   git://linux-nfs.org/~bfields/linux.git for-3.9
head:   deb4534f
commit: 01a7decf [32/44] nfsd: keep a checksum of the first 256 bytes of request
config: i386-randconfig-x088 (attached as .config)

All warnings:

   fs/nfsd/nfscache.c: In function 'nfsd_cache_csum':
>> fs/nfsd/nfscache.c:266:9: warning: comparison of distinct pointer types lacks a cast [enabled by default]

vim +266 fs/nfsd/nfscache.c

   250		__wsum csum;
   251		struct xdr_buf *buf = &rqstp->rq_arg;
   252		const unsigned char *p = buf->head[0].iov_base;
   253		size_t csum_len = min_t(size_t, buf->head[0].iov_len + buf->page_len,
   254					RC_CSUMLEN);
   255		size_t len = min(buf->head[0].iov_len, csum_len);
   256
   257		/* rq_arg.head first */
   258		csum = csum_partial(p, len, 0);
   259		csum_len -= len;
   260
   261		/* Continue into page array */
   262		idx = buf->page_base / PAGE_SIZE;
   263		base = buf->page_base & ~PAGE_MASK;
   264		while (csum_len) {
   265			p = page_address(buf->pages[idx]) + base;
 > 266			len = min(PAGE_SIZE - base, csum_len);
   267			csum = csum_partial(p, len, csum);
   268			csum_len -= len;
   269			base = 0;
   270			++idx;
   271		}
   272		return csum;
   273	}
   274
Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
Reported-by: default avatarkbuild test robot <fengguang.wu@intel.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent cc630d9f
...@@ -263,7 +263,7 @@ nfsd_cache_csum(struct svc_rqst *rqstp) ...@@ -263,7 +263,7 @@ nfsd_cache_csum(struct svc_rqst *rqstp)
base = buf->page_base & ~PAGE_MASK; base = buf->page_base & ~PAGE_MASK;
while (csum_len) { while (csum_len) {
p = page_address(buf->pages[idx]) + base; p = page_address(buf->pages[idx]) + base;
len = min(PAGE_SIZE - base, csum_len); len = min_t(size_t, PAGE_SIZE - base, csum_len);
csum = csum_partial(p, len, csum); csum = csum_partial(p, len, csum);
csum_len -= len; csum_len -= len;
base = 0; base = 0;
......
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