Skip to content

Commit

Permalink
sunrpc: properly type argument to kxdreproc_t
Browse files Browse the repository at this point in the history
Pass struct rpc_request as the first argument instead of an untyped blob,
and mark the data object as const.

Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Jeff Layton <[email protected]>
  • Loading branch information
Christoph Hellwig committed May 15, 2017
1 parent 2ea659a commit c512f36
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion include/linux/sunrpc/xdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include <asm/unaligned.h>
#include <linux/scatterlist.h>

struct rpc_rqst;

/*
* Buffer adjustment
*/
Expand Down Expand Up @@ -222,7 +224,8 @@ struct xdr_stream {
/*
* These are the xdr_stream style generic XDR encode and decode functions.
*/
typedef void (*kxdreproc_t)(void *rqstp, struct xdr_stream *xdr, void *obj);
typedef void (*kxdreproc_t)(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
const void *obj);
typedef int (*kxdrdproc_t)(void *rqstp, struct xdr_stream *xdr, void *obj);

extern void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p);
Expand Down
3 changes: 2 additions & 1 deletion net/sunrpc/clnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2476,7 +2476,8 @@ rpc_verify_header(struct rpc_task *task)
goto out_garbage;
}

static void rpcproc_encode_null(void *rqstp, struct xdr_stream *xdr, void *obj)
static void rpcproc_encode_null(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
const void *obj)
{
}

Expand Down

0 comments on commit c512f36

Please sign in to comment.