• Jeff Layton's avatar
    nfsd: fix compiler warning about ambiguous types in nfsd_cache_csum · 56edc86b
    Jeff Layton authored
    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>
    56edc86b
nfscache.c 12.7 KB