From: Chuck Lever Date: Wed, 4 Feb 2015 21:59:32 +0000 (-0500) Subject: xprtrdma: Address sparse complaint in rpcr_to_rdmar() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b625a61698619c7af652de2701a2fb17c5c5d66e;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git xprtrdma: Address sparse complaint in rpcr_to_rdmar() With "make ARCH=x86_64 allmodconfig make C=1 CF=-D__CHECK_ENDIAN__": linux-2.6/net/sunrpc/xprtrdma/xprt_rdma.h:273:30: warning: incorrect type in initializer (different base types) linux-2.6/net/sunrpc/xprtrdma/xprt_rdma.h:273:30: expected restricted __be32 [usertype] *buffer linux-2.6/net/sunrpc/xprtrdma/xprt_rdma.h:273:30: got unsigned int [usertype] *rq_buffer As far as I can tell this is a false positive. Reported-by: kbuild-all@01.org Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker --- diff --git a/net/sunrpc/xprtrdma/xprt_rdma.h b/net/sunrpc/xprtrdma/xprt_rdma.h index c9d2a02f631b..d1b70397c60f 100644 --- a/net/sunrpc/xprtrdma/xprt_rdma.h +++ b/net/sunrpc/xprtrdma/xprt_rdma.h @@ -270,9 +270,10 @@ struct rpcrdma_req { static inline struct rpcrdma_req * rpcr_to_rdmar(struct rpc_rqst *rqst) { - struct rpcrdma_regbuf *rb = container_of(rqst->rq_buffer, - struct rpcrdma_regbuf, - rg_base[0]); + void *buffer = rqst->rq_buffer; + struct rpcrdma_regbuf *rb; + + rb = container_of(buffer, struct rpcrdma_regbuf, rg_base); return rb->rg_owner; }