]> git.karo-electronics.de Git - karo-tx-linux.git/commit
nfsd: fix compiler warning about ambiguous types in nfsd_cache_csum
authorJeff Layton <jlayton@redhat.com>
Fri, 15 Feb 2013 18:36:34 +0000 (13:36 -0500)
committerJ. Bruce Fields <bfields@redhat.com>
Sun, 17 Feb 2013 16:02:23 +0000 (11:02 -0500)
commit56edc86b5a72bdbc86358e57fb09165136baf0b8
tree90fbf1e11f144f0bee1e17beb632bdc8681e5110
parentcc630d9f476445927fca599f81182c7f06f79058
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:   deb4534f4f3be7aea7d9d24c3b0d58f370cbf9ef
commit: 01a7decf75930925322c5efc87af0b5e58eb8650 [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: Jeff Layton <jlayton@redhat.com>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfscache.c