Message ID | 20170717091400.21866-4-stewart@linux.vnet.ibm.com |
---|---|
State | Accepted |
Headers | show |
On Mon, 2017-07-17 at 19:13 +1000, Stewart Smith wrote: > Mostly unused parameter warnings due to callbacks > > Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Reviewed-by: Cyril Bur <cyril.bur@au1.ibm.com> > --- > external/gard/gard.c | 22 +++++++++++++++++++++- > 1 file changed, 21 insertions(+), 1 deletion(-) > > diff --git a/external/gard/gard.c b/external/gard/gard.c > index 32a0003f4811..c5cb93b8830a 100644 > --- a/external/gard/gard.c > +++ b/external/gard/gard.c > @@ -260,6 +260,9 @@ static int do_iterate(struct gard_ctx *ctx, > > static int get_largest_pos_i(struct gard_ctx *ctx, int pos, struct gard_record *gard, void *priv) > { > + (void)ctx; > + (void)gard; > + > if (!priv) > return -1; > > @@ -272,6 +275,8 @@ static int get_largest_pos(struct gard_ctx *ctx) > { > int rc, largest = -1; > > + (void)ctx; > + > rc = do_iterate(ctx, &get_largest_pos_i, &largest); > if (rc) > return -1; > @@ -281,6 +286,9 @@ static int get_largest_pos(struct gard_ctx *ctx) > > static int count_valid_records_i(struct gard_ctx *ctx, int pos, struct gard_record *gard, void *priv) > { > + (void)ctx; > + (void)pos; > + > if (!gard || !priv) > return -1; > > @@ -303,6 +311,10 @@ static int count_valid_records(struct gard_ctx *ctx) > > static int do_list_i(struct gard_ctx *ctx, int pos, struct gard_record *gard, void *priv) > { > + (void)ctx; > + (void)pos; > + (void)priv; > + > if (!gard) > return -1; > > @@ -317,6 +329,9 @@ static int do_list(struct gard_ctx *ctx, int argc, char **argv) > { > int rc; > > + (void)argc; > + (void)argv; > + > /* No entries */ > if (count_valid_records(ctx) == 0) { > printf("No GARD entries to display\n"); > @@ -335,6 +350,9 @@ static int do_show_i(struct gard_ctx *ctx, int pos, struct gard_record *gard, vo > { > uint32_t id; > > + (void)ctx; > + (void)pos; > + > if (!priv || !gard) > return -1; > > @@ -477,7 +495,7 @@ static int do_clear(struct gard_ctx *ctx, int argc, char **argv) > return rc; > } > > -int check_gard_partition(struct gard_ctx *ctx) > +static int check_gard_partition(struct gard_ctx *ctx) > { > int rc; > struct gard_record gard; > @@ -520,6 +538,8 @@ int check_gard_partition(struct gard_ctx *ctx) > __attribute__ ((unused)) > static int do_nop(struct gard_ctx *ctx, int argc, char **argv) > { > + (void)ctx; > + (void)argc; > fprintf(stderr, "Unimplemented action '%s'\n", argv[0]); > return EXIT_SUCCESS; > }
diff --git a/external/gard/gard.c b/external/gard/gard.c index 32a0003f4811..c5cb93b8830a 100644 --- a/external/gard/gard.c +++ b/external/gard/gard.c @@ -260,6 +260,9 @@ static int do_iterate(struct gard_ctx *ctx, static int get_largest_pos_i(struct gard_ctx *ctx, int pos, struct gard_record *gard, void *priv) { + (void)ctx; + (void)gard; + if (!priv) return -1; @@ -272,6 +275,8 @@ static int get_largest_pos(struct gard_ctx *ctx) { int rc, largest = -1; + (void)ctx; + rc = do_iterate(ctx, &get_largest_pos_i, &largest); if (rc) return -1; @@ -281,6 +286,9 @@ static int get_largest_pos(struct gard_ctx *ctx) static int count_valid_records_i(struct gard_ctx *ctx, int pos, struct gard_record *gard, void *priv) { + (void)ctx; + (void)pos; + if (!gard || !priv) return -1; @@ -303,6 +311,10 @@ static int count_valid_records(struct gard_ctx *ctx) static int do_list_i(struct gard_ctx *ctx, int pos, struct gard_record *gard, void *priv) { + (void)ctx; + (void)pos; + (void)priv; + if (!gard) return -1; @@ -317,6 +329,9 @@ static int do_list(struct gard_ctx *ctx, int argc, char **argv) { int rc; + (void)argc; + (void)argv; + /* No entries */ if (count_valid_records(ctx) == 0) { printf("No GARD entries to display\n"); @@ -335,6 +350,9 @@ static int do_show_i(struct gard_ctx *ctx, int pos, struct gard_record *gard, vo { uint32_t id; + (void)ctx; + (void)pos; + if (!priv || !gard) return -1; @@ -477,7 +495,7 @@ static int do_clear(struct gard_ctx *ctx, int argc, char **argv) return rc; } -int check_gard_partition(struct gard_ctx *ctx) +static int check_gard_partition(struct gard_ctx *ctx) { int rc; struct gard_record gard; @@ -520,6 +538,8 @@ int check_gard_partition(struct gard_ctx *ctx) __attribute__ ((unused)) static int do_nop(struct gard_ctx *ctx, int argc, char **argv) { + (void)ctx; + (void)argc; fprintf(stderr, "Unimplemented action '%s'\n", argv[0]); return EXIT_SUCCESS; }
Mostly unused parameter warnings due to callbacks Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> --- external/gard/gard.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)