1 From a3c9d87924455448cf3bcb20d34f1bd4e6b915d8 Mon Sep 17 00:00:00 2001
2 From: Robbie Harwood <rharwood@redhat.com>
3 Date: Wed, 15 Mar 2017 13:52:36 -0400
4 Subject: [PATCH] Fix unused variables
6 Signed-off-by: Robbie Harwood <rharwood@redhat.com>
7 Reviewed-by: Simo Sorce <simo@redhat.com>
9 (cherry picked from commit e72d1fa53df8af55b47639ed01f9f0bafa7a2ca8)
11 proxy/src/client/gpm_common.c | 1 +
12 proxy/src/client/gpm_display_status.c | 2 +-
13 proxy/src/client/gpm_release_handle.c | 2 +-
14 proxy/src/gp_common.h | 1 +
15 proxy/src/gp_config.c | 8 ++------
16 proxy/src/gp_conv.c | 4 ++--
17 proxy/src/gp_conv.h | 3 +--
18 proxy/src/gp_creds.c | 7 +++----
19 proxy/src/gp_init.c | 2 +-
20 proxy/src/gp_rpc_accept_sec_context.c | 3 +--
21 proxy/src/gp_rpc_acquire_cred.c | 3 +--
22 proxy/src/gp_rpc_get_mic.c | 4 ++--
23 proxy/src/gp_rpc_import_and_canon_name.c | 5 ++---
24 proxy/src/gp_rpc_indicate_mechs.c | 5 ++---
25 proxy/src/gp_rpc_init_sec_context.c | 3 +--
26 proxy/src/gp_rpc_process.c | 21 ++++-----------------
27 proxy/src/gp_rpc_process.h | 6 ++++++
28 proxy/src/gp_rpc_release_handle.c | 5 ++---
29 proxy/src/gp_rpc_unwrap.c | 5 ++---
30 proxy/src/gp_rpc_verify_mic.c | 5 ++---
31 proxy/src/gp_rpc_wrap.c | 4 ++--
32 proxy/src/gp_rpc_wrap_size_limit.c | 5 ++---
33 proxy/src/gp_socket.c | 2 +-
34 proxy/src/gssproxy.c | 2 +-
35 24 files changed, 44 insertions(+), 64 deletions(-)
37 diff --git a/proxy/src/client/gpm_common.c b/proxy/src/client/gpm_common.c
38 index 0a54dbc..030765a 100644
39 --- a/proxy/src/client/gpm_common.c
40 +++ b/proxy/src/client/gpm_common.c
41 @@ -320,6 +320,7 @@ static void gpm_release_ctx(struct gpm_ctx *gpmctx)
42 OM_uint32 gpm_release_buffer(OM_uint32 *minor_status,
46 if (buffer != GSS_C_NO_BUFFER) {
49 diff --git a/proxy/src/client/gpm_display_status.c b/proxy/src/client/gpm_display_status.c
50 index 1f8d755..bbb546f 100644
51 --- a/proxy/src/client/gpm_display_status.c
52 +++ b/proxy/src/client/gpm_display_status.c
53 @@ -43,7 +43,7 @@ void gpm_save_internal_status(uint32_t err, char *err_str)
54 OM_uint32 gpm_display_status(OM_uint32 *minor_status,
55 OM_uint32 status_value,
57 - const gss_OID mech_type,
58 + const gss_OID mech_type UNUSED,
59 OM_uint32 *message_context,
60 gss_buffer_t status_string)
62 diff --git a/proxy/src/client/gpm_release_handle.c b/proxy/src/client/gpm_release_handle.c
63 index 7a6aaed..8f49ee9 100644
64 --- a/proxy/src/client/gpm_release_handle.c
65 +++ b/proxy/src/client/gpm_release_handle.c
66 @@ -58,7 +58,7 @@ done:
68 OM_uint32 gpm_delete_sec_context(OM_uint32 *minor_status,
69 gssx_ctx **context_handle,
70 - gss_buffer_t output_token)
71 + gss_buffer_t output_token UNUSED)
73 union gp_rpc_arg uarg;
74 union gp_rpc_res ures;
75 diff --git a/proxy/src/gp_common.h b/proxy/src/gp_common.h
76 index 36fd843..edc23b4 100644
77 --- a/proxy/src/gp_common.h
78 +++ b/proxy/src/gp_common.h
82 #define no_const(ptr) ((void *)((uintptr_t)(ptr)))
83 +#define UNUSED __attribute__((unused))
85 /* add element to list head */
86 #define LIST_ADD(list, elem) do { \
87 diff --git a/proxy/src/gp_config.c b/proxy/src/gp_config.c
88 index 1b833fd..5c1ca02 100644
89 --- a/proxy/src/gp_config.c
90 +++ b/proxy/src/gp_config.c
91 @@ -720,7 +720,6 @@ void free_config(struct gp_config **cfg)
94 static int gp_config_from_file(const char *config_file,
95 - struct gp_ini_context *ctx,
96 struct ini_cfgobj *ini_config,
97 const uint32_t collision_flags)
99 @@ -764,7 +763,6 @@ static int gp_config_from_file(const char *config_file,
102 static int gp_config_from_dir(const char *config_dir,
103 - struct gp_ini_context *ctx,
104 struct ini_cfgobj **ini_config,
105 const uint32_t collision_flags)
107 @@ -847,8 +845,7 @@ int gp_config_init(const char *config_file, const char *config_dir,
111 - ret = gp_config_from_file(config_file, ctx, ini_config,
113 + ret = gp_config_from_file(config_file, ini_config, collision_flags);
115 GPDEBUG("Expected config file %s but did not find it.\n",
117 @@ -857,8 +854,7 @@ int gp_config_init(const char *config_file, const char *config_dir,
121 - ret = gp_config_from_dir(config_dir, ctx, &ini_config,
123 + ret = gp_config_from_dir(config_dir, &ini_config, collision_flags);
127 diff --git a/proxy/src/gp_conv.c b/proxy/src/gp_conv.c
128 index 6aa66a8..71d6d9d 100644
129 --- a/proxy/src/gp_conv.c
130 +++ b/proxy/src/gp_conv.c
135 +#include "src/gp_common.h"
137 void *gp_memdup(void *in, size_t len)
139 @@ -488,8 +489,7 @@ done:
143 -int gp_conv_status_to_gssx(struct gssx_call_ctx *call_ctx,
144 - uint32_t ret_maj, uint32_t ret_min,
145 +int gp_conv_status_to_gssx(uint32_t ret_maj, uint32_t ret_min,
146 gss_OID mech, struct gssx_status *status)
149 diff --git a/proxy/src/gp_conv.h b/proxy/src/gp_conv.h
150 index e247dbd..699b301 100644
151 --- a/proxy/src/gp_conv.h
152 +++ b/proxy/src/gp_conv.h
153 @@ -39,8 +39,7 @@ uint32_t gp_conv_name_to_gssx_alloc(uint32_t *min,
154 gss_name_t in, gssx_name **out);
155 uint32_t gp_conv_gssx_to_name(uint32_t *min, gssx_name *in, gss_name_t *out);
157 -int gp_conv_status_to_gssx(struct gssx_call_ctx *call_ctx,
158 - uint32_t ret_maj, uint32_t ret_min,
159 +int gp_conv_status_to_gssx(uint32_t ret_maj, uint32_t ret_min,
160 gss_OID mech, struct gssx_status *status);
162 int gp_copy_utf8string(utf8string *in, utf8string *out);
163 diff --git a/proxy/src/gp_creds.c b/proxy/src/gp_creds.c
164 index 7d89b06..6570b06 100644
165 --- a/proxy/src/gp_creds.c
166 +++ b/proxy/src/gp_creds.c
167 @@ -252,7 +252,6 @@ done:
169 static int ensure_segregated_ccache(struct gp_call_ctx *gpcall,
171 - struct gp_service *svc,
172 gss_key_value_set_desc *cs)
175 @@ -482,7 +481,7 @@ static int gp_get_cred_environment(struct gp_call_ctx *gpcall,
179 - ret = ensure_segregated_ccache(gpcall, cc_num, svc, cs);
180 + ret = ensure_segregated_ccache(gpcall, cc_num, cs);
184 @@ -587,8 +586,8 @@ uint32_t gp_add_krb5_creds(uint32_t *min,
185 gss_cred_id_t in_cred,
186 gssx_name *desired_name,
187 gss_cred_usage_t cred_usage,
188 - uint32_t initiator_time_req,
189 - uint32_t acceptor_time_req,
190 + uint32_t initiator_time_req UNUSED,
191 + uint32_t acceptor_time_req UNUSED,
192 gss_cred_id_t *output_cred_handle,
193 gss_OID_set *actual_mechs,
194 uint32_t *initiator_time_rec,
195 diff --git a/proxy/src/gp_init.c b/proxy/src/gp_init.c
196 index d367f92..e69934d 100644
197 --- a/proxy/src/gp_init.c
198 +++ b/proxy/src/gp_init.c
199 @@ -96,7 +96,7 @@ void fini_server(void)
203 -static void break_loop(verto_ctx *vctx, verto_ev *ev)
204 +static void break_loop(verto_ctx *vctx, verto_ev *ev UNUSED)
206 GPDEBUG("Exiting after receiving a signal\n");
208 diff --git a/proxy/src/gp_rpc_accept_sec_context.c b/proxy/src/gp_rpc_accept_sec_context.c
209 index 22a4cf7..ae4de55 100644
210 --- a/proxy/src/gp_rpc_accept_sec_context.c
211 +++ b/proxy/src/gp_rpc_accept_sec_context.c
212 @@ -152,8 +152,7 @@ done:
216 - ret = gp_conv_status_to_gssx(&asca->call_ctx,
217 - ret_maj, ret_min, oid,
218 + ret = gp_conv_status_to_gssx(ret_maj, ret_min, oid,
220 GPRPCDEBUG(gssx_res_accept_sec_context, ascr);
222 diff --git a/proxy/src/gp_rpc_acquire_cred.c b/proxy/src/gp_rpc_acquire_cred.c
223 index 9a55937..e9c7d56 100644
224 --- a/proxy/src/gp_rpc_acquire_cred.c
225 +++ b/proxy/src/gp_rpc_acquire_cred.c
226 @@ -150,8 +150,7 @@ int gp_acquire_cred(struct gp_call_ctx *gpcall,
230 - ret = gp_conv_status_to_gssx(&aca->call_ctx,
231 - ret_maj, ret_min, desired_mech,
232 + ret = gp_conv_status_to_gssx(ret_maj, ret_min, desired_mech,
235 GPRPCDEBUG(gssx_res_acquire_cred, acr);
236 diff --git a/proxy/src/gp_rpc_get_mic.c b/proxy/src/gp_rpc_get_mic.c
237 index 1d9a1fe..dfba77e 100644
238 --- a/proxy/src/gp_rpc_get_mic.c
239 +++ b/proxy/src/gp_rpc_get_mic.c
241 #include "gp_rpc_process.h"
242 #include <gssapi/gssapi.h>
244 -int gp_get_mic(struct gp_call_ctx *gpcall,
245 +int gp_get_mic(struct gp_call_ctx *gpcall UNUSED,
246 union gp_rpc_arg *arg,
247 union gp_rpc_res *res)
249 @@ -79,7 +79,7 @@ int gp_get_mic(struct gp_call_ctx *gpcall,
253 - ret = gp_conv_status_to_gssx(&gma->call_ctx, ret_maj, ret_min,
254 + ret = gp_conv_status_to_gssx(ret_maj, ret_min,
255 GSS_C_NO_OID, &gmr->status);
256 GPRPCDEBUG(gssx_res_get_mic, gmr);
257 gss_release_buffer(&ret_min, &message_token);
258 diff --git a/proxy/src/gp_rpc_import_and_canon_name.c b/proxy/src/gp_rpc_import_and_canon_name.c
259 index 3d67f40..e7b8e63 100644
260 --- a/proxy/src/gp_rpc_import_and_canon_name.c
261 +++ b/proxy/src/gp_rpc_import_and_canon_name.c
263 * I am not kidding, if you hav not read it, go back and do it now, or do not
264 * touch this function */
266 -int gp_import_and_canon_name(struct gp_call_ctx *gpcall,
267 +int gp_import_and_canon_name(struct gp_call_ctx *gpcall UNUSED,
268 union gp_rpc_arg *arg,
269 union gp_rpc_res *res)
271 @@ -64,8 +64,7 @@ int gp_import_and_canon_name(struct gp_call_ctx *gpcall,
272 /* TODO: icna->name_attributes */
275 - ret = gp_conv_status_to_gssx(&icna->call_ctx,
276 - ret_maj, ret_min, mech,
277 + ret = gp_conv_status_to_gssx(ret_maj, ret_min, mech,
279 GPRPCDEBUG(gssx_res_import_and_canon_name, icnr);
281 diff --git a/proxy/src/gp_rpc_indicate_mechs.c b/proxy/src/gp_rpc_indicate_mechs.c
282 index c24b926..8abbc7f 100644
283 --- a/proxy/src/gp_rpc_indicate_mechs.c
284 +++ b/proxy/src/gp_rpc_indicate_mechs.c
286 #include "gp_rpc_process.h"
287 #include "gp_debug.h"
289 -int gp_indicate_mechs(struct gp_call_ctx *gpcall,
290 +int gp_indicate_mechs(struct gp_call_ctx *gpcall UNUSED,
291 union gp_rpc_arg *arg,
292 union gp_rpc_res *res)
294 @@ -251,8 +251,7 @@ int gp_indicate_mechs(struct gp_call_ctx *gpcall,
298 - ret = gp_conv_status_to_gssx(&ima->call_ctx,
299 - ret_maj, ret_min, GSS_C_NO_OID,
300 + ret = gp_conv_status_to_gssx(ret_maj, ret_min, GSS_C_NO_OID,
302 GPRPCDEBUG(gssx_res_indicate_mechs, imr);
304 diff --git a/proxy/src/gp_rpc_init_sec_context.c b/proxy/src/gp_rpc_init_sec_context.c
305 index 413e2ec..e4af495 100644
306 --- a/proxy/src/gp_rpc_init_sec_context.c
307 +++ b/proxy/src/gp_rpc_init_sec_context.c
308 @@ -187,8 +187,7 @@ done:
312 - ret = gp_conv_status_to_gssx(&isca->call_ctx,
313 - ret_maj, ret_min, mech_type,
314 + ret = gp_conv_status_to_gssx(ret_maj, ret_min, mech_type,
317 GPRPCDEBUG(gssx_res_init_sec_context, iscr);
318 diff --git a/proxy/src/gp_rpc_process.c b/proxy/src/gp_rpc_process.c
319 index d1a0232..0ea17f0 100644
320 --- a/proxy/src/gp_rpc_process.c
321 +++ b/proxy/src/gp_rpc_process.c
322 @@ -396,20 +396,7 @@ int gp_rpc_process_call(struct gp_call_ctx *gpcall,
326 -int gp_get_call_context(gp_exec_std_args)
330 -int gp_export_cred(gp_exec_std_args)
334 -int gp_import_cred(gp_exec_std_args)
339 -int gp_store_cred(gp_exec_std_args)
343 +GP_EXEC_UNUSED_FUNC(gp_get_call_context);
344 +GP_EXEC_UNUSED_FUNC(gp_export_cred);
345 +GP_EXEC_UNUSED_FUNC(gp_import_cred);
346 +GP_EXEC_UNUSED_FUNC(gp_store_cred);
347 diff --git a/proxy/src/gp_rpc_process.h b/proxy/src/gp_rpc_process.h
348 index eb02c95..da27795 100644
349 --- a/proxy/src/gp_rpc_process.h
350 +++ b/proxy/src/gp_rpc_process.h
351 @@ -24,6 +24,12 @@ struct gp_service;
352 union gp_rpc_arg *arg, \
353 union gp_rpc_res *res
355 +#define GP_EXEC_UNUSED_FUNC(name) \
356 + int name(struct gp_call_ctx *gpcall UNUSED, \
357 + union gp_rpc_arg *arg UNUSED, \
358 + union gp_rpc_res *res UNUSED) \
361 int gp_indicate_mechs(gp_exec_std_args);
362 int gp_get_call_context(gp_exec_std_args);
363 int gp_import_and_canon_name(gp_exec_std_args);
364 diff --git a/proxy/src/gp_rpc_release_handle.c b/proxy/src/gp_rpc_release_handle.c
365 index 4ffdfb9..c8ba8f2 100644
366 --- a/proxy/src/gp_rpc_release_handle.c
367 +++ b/proxy/src/gp_rpc_release_handle.c
370 #include "gp_rpc_process.h"
372 -int gp_release_handle(struct gp_call_ctx *gpcall,
373 +int gp_release_handle(struct gp_call_ctx *gpcall UNUSED,
374 union gp_rpc_arg *arg,
375 union gp_rpc_res *res)
377 @@ -35,8 +35,7 @@ int gp_release_handle(struct gp_call_ctx *gpcall,
381 - ret = gp_conv_status_to_gssx(&rha->call_ctx,
382 - ret_maj, ret_min, GSS_C_NO_OID,
383 + ret = gp_conv_status_to_gssx(ret_maj, ret_min, GSS_C_NO_OID,
385 GPRPCDEBUG(gssx_res_release_handle, rhr);
387 diff --git a/proxy/src/gp_rpc_unwrap.c b/proxy/src/gp_rpc_unwrap.c
388 index bc052cb..fad8cfe 100644
389 --- a/proxy/src/gp_rpc_unwrap.c
390 +++ b/proxy/src/gp_rpc_unwrap.c
392 #include "gp_rpc_process.h"
393 #include <gssapi/gssapi.h>
395 -int gp_unwrap(struct gp_call_ctx *gpcall,
396 +int gp_unwrap(struct gp_call_ctx *gpcall UNUSED,
397 union gp_rpc_arg *arg,
398 union gp_rpc_res *res)
400 @@ -106,8 +106,7 @@ int gp_unwrap(struct gp_call_ctx *gpcall,
404 - ret = gp_conv_status_to_gssx(&uwa->call_ctx,
406 + ret = gp_conv_status_to_gssx(ret_maj, ret_min,
409 GPRPCDEBUG(gssx_res_unwrap, uwr);
410 diff --git a/proxy/src/gp_rpc_verify_mic.c b/proxy/src/gp_rpc_verify_mic.c
411 index d2920d2..6da6dac 100644
412 --- a/proxy/src/gp_rpc_verify_mic.c
413 +++ b/proxy/src/gp_rpc_verify_mic.c
415 #include "gp_rpc_process.h"
416 #include <gssapi/gssapi.h>
418 -int gp_verify_mic(struct gp_call_ctx *gpcall,
419 +int gp_verify_mic(struct gp_call_ctx *gpcall UNUSED,
420 union gp_rpc_arg *arg,
421 union gp_rpc_res *res)
423 @@ -74,8 +74,7 @@ int gp_verify_mic(struct gp_call_ctx *gpcall,
427 - ret = gp_conv_status_to_gssx(&vma->call_ctx,
429 + ret = gp_conv_status_to_gssx(ret_maj, ret_min,
432 GPRPCDEBUG(gssx_res_verify_mic, vmr);
433 diff --git a/proxy/src/gp_rpc_wrap.c b/proxy/src/gp_rpc_wrap.c
434 index d5c950e..ae20bdb 100644
435 --- a/proxy/src/gp_rpc_wrap.c
436 +++ b/proxy/src/gp_rpc_wrap.c
438 #include "gp_rpc_process.h"
439 #include <gssapi/gssapi.h>
441 -int gp_wrap(struct gp_call_ctx *gpcall,
442 +int gp_wrap(struct gp_call_ctx *gpcall UNUSED,
443 union gp_rpc_arg *arg,
444 union gp_rpc_res *res)
446 @@ -105,7 +105,7 @@ int gp_wrap(struct gp_call_ctx *gpcall,
450 - ret = gp_conv_status_to_gssx(&wa->call_ctx, ret_maj, ret_min,
451 + ret = gp_conv_status_to_gssx(ret_maj, ret_min,
452 GSS_C_NO_OID, &wr->status);
453 GPRPCDEBUG(gssx_res_wrap, wr);
454 gss_release_buffer(&ret_min, &output_message_buffer);
455 diff --git a/proxy/src/gp_rpc_wrap_size_limit.c b/proxy/src/gp_rpc_wrap_size_limit.c
456 index 355113c..cab6826 100644
457 --- a/proxy/src/gp_rpc_wrap_size_limit.c
458 +++ b/proxy/src/gp_rpc_wrap_size_limit.c
460 #include "gp_rpc_process.h"
461 #include <gssapi/gssapi.h>
463 -int gp_wrap_size_limit(struct gp_call_ctx *gpcall,
464 +int gp_wrap_size_limit(struct gp_call_ctx *gpcall UNUSED,
465 union gp_rpc_arg *arg,
466 union gp_rpc_res *res)
468 @@ -51,8 +51,7 @@ int gp_wrap_size_limit(struct gp_call_ctx *gpcall,
472 - ret = gp_conv_status_to_gssx(&wsla->call_ctx,
474 + ret = gp_conv_status_to_gssx(ret_maj, ret_min,
477 GPRPCDEBUG(gssx_res_wrap_size_limit, wslr);
478 diff --git a/proxy/src/gp_socket.c b/proxy/src/gp_socket.c
479 index 62d7dbc..829ff21 100644
480 --- a/proxy/src/gp_socket.c
481 +++ b/proxy/src/gp_socket.c
482 @@ -146,7 +146,7 @@ static int set_fd_flags(int fd, int flags)
486 -void free_unix_socket(verto_ctx *ctx, verto_ev *ev)
487 +void free_unix_socket(verto_ctx *ctx UNUSED, verto_ev *ev)
489 struct gp_sock_ctx *sock_ctx = NULL;
490 sock_ctx = verto_get_private(ev);
491 diff --git a/proxy/src/gssproxy.c b/proxy/src/gssproxy.c
492 index 561188e..a020218 100644
493 --- a/proxy/src/gssproxy.c
494 +++ b/proxy/src/gssproxy.c
495 @@ -119,7 +119,7 @@ static int init_sockets(verto_ctx *vctx, struct gp_config *old_config)
499 -static void hup_handler(verto_ctx *vctx, verto_ev *ev)
500 +static void hup_handler(verto_ctx *vctx, verto_ev *ev UNUSED)
503 struct gp_config *new_config, *old_config;