All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Trond Myklebust <trond.myklebust@primarydata.com>,
	Anna Schumaker <anna.schumaker@netapp.com>,
	"J. Bruce Fields" <bfields@fieldses.org>,
	Jeff Layton <jlayton@poochiereds.net>
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 06/32] sunrpc/auth_gss: nfsd: fix encoder callback prototypes
Date: Tue,  9 May 2017 11:19:44 +0200	[thread overview]
Message-ID: <20170509092010.30752-7-hch@lst.de> (raw)
In-Reply-To: <20170509092010.30752-1-hch@lst.de>

Declare the p_encode callbacks with the proper prototype instead of
casting to kxdreproc_t and losing all type safety.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 net/sunrpc/auth_gss/gss_rpc_upcall.c |  2 +-
 net/sunrpc/auth_gss/gss_rpc_xdr.c    | 11 ++++++-----
 net/sunrpc/auth_gss/gss_rpc_xdr.h    |  2 +-
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/net/sunrpc/auth_gss/gss_rpc_upcall.c b/net/sunrpc/auth_gss/gss_rpc_upcall.c
index f0c6a8c78a56..45ab924da726 100644
--- a/net/sunrpc/auth_gss/gss_rpc_upcall.c
+++ b/net/sunrpc/auth_gss/gss_rpc_upcall.c
@@ -55,7 +55,7 @@ enum {
 #define PROC(proc, name)				\
 [GSSX_##proc] = {					\
 	.p_proc   = GSSX_##proc,			\
-	.p_encode = (kxdreproc_t)gssx_enc_##name,	\
+	.p_encode = gssx_enc_##name,	\
 	.p_decode = (kxdrdproc_t)gssx_dec_##name,	\
 	.p_arglen = GSSX_ARG_##name##_sz,		\
 	.p_replen = GSSX_RES_##name##_sz, 		\
diff --git a/net/sunrpc/auth_gss/gss_rpc_xdr.c b/net/sunrpc/auth_gss/gss_rpc_xdr.c
index 25d9a9cf7b66..5e54f4743092 100644
--- a/net/sunrpc/auth_gss/gss_rpc_xdr.c
+++ b/net/sunrpc/auth_gss/gss_rpc_xdr.c
@@ -44,7 +44,7 @@ static int gssx_dec_bool(struct xdr_stream *xdr, u32 *v)
 }
 
 static int gssx_enc_buffer(struct xdr_stream *xdr,
-			   gssx_buffer *buf)
+			   const gssx_buffer *buf)
 {
 	__be32 *p;
 
@@ -56,7 +56,7 @@ static int gssx_enc_buffer(struct xdr_stream *xdr,
 }
 
 static int gssx_enc_in_token(struct xdr_stream *xdr,
-			     struct gssp_in_token *in)
+			     const struct gssp_in_token *in)
 {
 	__be32 *p;
 
@@ -130,7 +130,7 @@ static int gssx_dec_option(struct xdr_stream *xdr,
 }
 
 static int dummy_enc_opt_array(struct xdr_stream *xdr,
-				struct gssx_option_array *oa)
+				const struct gssx_option_array *oa)
 {
 	__be32 *p;
 
@@ -348,7 +348,7 @@ static int gssx_dec_status(struct xdr_stream *xdr,
 }
 
 static int gssx_enc_call_ctx(struct xdr_stream *xdr,
-			     struct gssx_call_ctx *ctx)
+			     const struct gssx_call_ctx *ctx)
 {
 	struct gssx_option opt;
 	__be32 *p;
@@ -733,8 +733,9 @@ static int gssx_enc_cb(struct xdr_stream *xdr, struct gssx_cb *cb)
 
 void gssx_enc_accept_sec_context(struct rpc_rqst *req,
 				 struct xdr_stream *xdr,
-				 struct gssx_arg_accept_sec_context *arg)
+				 const void *data)
 {
+	const struct gssx_arg_accept_sec_context *arg = data;
 	int err;
 
 	err = gssx_enc_call_ctx(xdr, &arg->call_ctx);
diff --git a/net/sunrpc/auth_gss/gss_rpc_xdr.h b/net/sunrpc/auth_gss/gss_rpc_xdr.h
index 9d88c6239f01..87cd719ca0ad 100644
--- a/net/sunrpc/auth_gss/gss_rpc_xdr.h
+++ b/net/sunrpc/auth_gss/gss_rpc_xdr.h
@@ -179,7 +179,7 @@ struct gssx_res_accept_sec_context {
 #define gssx_dec_init_sec_context NULL
 void gssx_enc_accept_sec_context(struct rpc_rqst *req,
 				 struct xdr_stream *xdr,
-				 struct gssx_arg_accept_sec_context *args);
+				 const void *data);
 int gssx_dec_accept_sec_context(struct rpc_rqst *rqstp,
 				struct xdr_stream *xdr,
 				struct gssx_res_accept_sec_context *res);
-- 
2.11.0


  parent reply	other threads:[~2017-05-09  9:20 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-09  9:19 RFC: remove function pointer casts and constify function tables Christoph Hellwig
2017-05-09  9:19 ` [PATCH 01/32] sunrpc: properly type argument to kxdreproc_t Christoph Hellwig
2017-05-09  9:19 ` [PATCH 02/32] sunrpc: fix encoder callback prototypes Christoph Hellwig
2017-05-09  9:43   ` Mkrtchyan, Tigran
2017-05-09 13:11     ` Christoph Hellwig
2017-05-09 13:30       ` Jeff Layton
2017-05-09 14:17         ` J. Bruce Fields
2017-05-10 18:38           ` J. Bruce Fields
2017-05-09 12:28   ` Trond Myklebust
2017-05-09  9:19 ` [PATCH 03/32] lockd: " Christoph Hellwig
2017-05-09 12:29   ` Trond Myklebust
2017-05-09  9:19 ` [PATCH 04/32] nfs: " Christoph Hellwig
2017-05-09 12:30   ` Trond Myklebust
2017-05-09  9:19 ` [PATCH 05/32] nfsd: " Christoph Hellwig
2017-05-09  9:19 ` Christoph Hellwig [this message]
2017-05-09 12:32   ` [PATCH 06/32] sunrpc/auth_gss: " Trond Myklebust
2017-05-09  9:19 ` [PATCH 07/32] sunrpc: properly type argument to kxdrdproc_t Christoph Hellwig
2017-05-09 12:34   ` Trond Myklebust
2017-05-09  9:19 ` [PATCH 08/32] sunrpc: fix decoder callback prototypes Christoph Hellwig
2017-05-09  9:19 ` [PATCH 09/32] sunrpc/auth_gss: " Christoph Hellwig
2017-05-09 12:35   ` Trond Myklebust
2017-05-09  9:19 ` [PATCH 10/32] nfsd: " Christoph Hellwig
2017-05-09  9:19 ` [PATCH 11/32] lockd: " Christoph Hellwig
2017-05-09 12:36   ` Trond Myklebust
2017-05-09  9:19 ` [PATCH 12/32] nfs: " Christoph Hellwig
2017-05-09 12:37   ` Trond Myklebust
2017-05-09  9:19 ` [PATCH 13/32] nfs: don't cast callback decode/proc/encode routines Christoph Hellwig
2017-05-09 12:38   ` Trond Myklebust
2017-05-09  9:19 ` [PATCH 14/32] RFC: sunrpc: remove p_count Christoph Hellwig
2017-05-09 12:41   ` Trond Myklebust
2017-05-09  9:19 ` [PATCH 15/32] sunrpc: mark all struct rpc_procinfo instances as const Christoph Hellwig
2017-05-09 12:42   ` Trond Myklebust
2017-05-09  9:19 ` [PATCH 16/32] lockd: fix some weird indentation Christoph Hellwig
2017-05-09 12:43   ` Trond Myklebust
2017-05-09  9:19 ` [PATCH 17/32] nfsd4: const-ify nfs_cb_version4 Christoph Hellwig
2017-05-09  9:19 ` [PATCH 18/32] nfsd: use named initializers in PROC() Christoph Hellwig
2017-05-09  9:19 ` [PATCH 19/32] nfsd: remove the unused PROC() macro in nfs3proc.c Christoph Hellwig
2017-05-09  9:19 ` [PATCH 20/32] sunrpc: properly type pc_func callbacks Christoph Hellwig
2017-05-09  9:19 ` [PATCH 21/32] sunrpc: properly type pc_release callbacks Christoph Hellwig
2017-05-09  9:20 ` [PATCH 22/32] sunrpc: properly type pc_decode callbacks Christoph Hellwig
2017-05-09  9:20 ` [PATCH 23/32] sunrpc: properly type pc_encode callbacks Christoph Hellwig
2017-05-09 12:10   ` Trond Myklebust
2017-05-09  9:20 ` [PATCH 24/32] sunrpc: remove kxdrproc_t Christoph Hellwig
2017-05-09  9:20 ` [PATCH 25/32] nfsd4: properly type op_set_currentstateid callbacks Christoph Hellwig
2017-05-09  9:20 ` [PATCH 26/32] nfsd4: properly type op_get_currentstateid callbacks Christoph Hellwig
2017-05-09  9:20 ` [PATCH 27/32] nfsd4: remove nfsd4op_rsize Christoph Hellwig
2017-05-09  9:20 ` [PATCH 28/32] nfsd4: properly type op_func callbacks Christoph Hellwig
2017-05-09  9:20 ` [PATCH 29/32] RFC: sunrpc: remove pc_count Christoph Hellwig
2017-05-09 12:16   ` Trond Myklebust
2017-05-09 13:43     ` Chuck Lever
2017-05-09 17:35   ` Jeff Layton
2017-05-09  9:20 ` [PATCH 30/32] sunrpc: mark all struct svc_procinfo instances as const Christoph Hellwig
2017-05-09  9:20 ` [PATCH 31/32] sunrpc: mark all struct svc_version " Christoph Hellwig
2017-05-09 12:11   ` Trond Myklebust
2017-05-09  9:20 ` [PATCH 32/32] nfsd4: const-ify nfsd4_ops Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170509092010.30752-7-hch@lst.de \
    --to=hch@lst.de \
    --cc=anna.schumaker@netapp.com \
    --cc=bfields@fieldses.org \
    --cc=jlayton@poochiereds.net \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@primarydata.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.