git: 3927d0fb373c - main - ifconfig: fix -Wunused warnings
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 14 Jun 2023 09:16:23 UTC
The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=3927d0fb373c04e99403c9a773312f650607441c commit 3927d0fb373c04e99403c9a773312f650607441c Author: Alexander V. Chernikov <melifaro@FreeBSD.org> AuthorDate: 2023-06-14 07:59:01 +0000 Commit: Alexander V. Chernikov <melifaro@FreeBSD.org> CommitDate: 2023-06-14 09:16:09 +0000 ifconfig: fix -Wunused warnings MFC after: 2 weeks --- sbin/ifconfig/af_inet.c | 2 +- sbin/ifconfig/af_inet6.c | 2 +- sbin/ifconfig/ifclone.c | 2 +- sbin/ifconfig/ifconfig.c | 16 ++++++++-------- sbin/ifconfig/ifconfig.h | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sbin/ifconfig/af_inet.c b/sbin/ifconfig/af_inet.c index 842fdad2a20f..0c6ae253cbd4 100644 --- a/sbin/ifconfig/af_inet.c +++ b/sbin/ifconfig/af_inet.c @@ -144,7 +144,7 @@ in_status(if_ctx *ctx __unused, const struct ifaddrs *ifa) printf(" broadcast %s", inet_ntoa(sin->sin_addr)); } - print_vhid(ifa, " "); + print_vhid(ifa); putchar('\n'); } diff --git a/sbin/ifconfig/af_inet6.c b/sbin/ifconfig/af_inet6.c index f1755bcb7a16..b8a5cb3012ed 100644 --- a/sbin/ifconfig/af_inet6.c +++ b/sbin/ifconfig/af_inet6.c @@ -356,7 +356,7 @@ in6_status(if_ctx *ctx __unused, const struct ifaddrs *ifa) print_lifetime("vltime", lifetime.ia6t_expire, &now); } - print_vhid(ifa, " "); + print_vhid(ifa); putchar('\n'); } diff --git a/sbin/ifconfig/ifclone.c b/sbin/ifconfig/ifclone.c index ecd8bbc2e556..f0ae93ec792c 100644 --- a/sbin/ifconfig/ifclone.c +++ b/sbin/ifconfig/ifclone.c @@ -151,7 +151,7 @@ ifclonecreate(if_ctx *ctx, void *arg __unused) } static void -clone_create(if_ctx *ctx, const char *cmd __unused, int d __unused) +clone_create(if_ctx *ctx __unused, const char *cmd __unused, int d __unused) { callback_register(ifclonecreate, NULL); } diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index e0aae77a317e..d30d3e1909ae 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1230,7 +1230,7 @@ top: } static void -setifaddr(if_ctx *ctx, const char *addr, int param) +setifaddr(if_ctx *ctx, const char *addr, int param __unused) { const struct afswtch *afp = ctx->afp; @@ -1279,10 +1279,10 @@ settunnel(if_ctx *ctx, const char *src, const char *dst) } static void -deletetunnel(if_ctx *ctx, const char *vname, int param) +deletetunnel(if_ctx *ctx, const char *vname __unused, int param __unused) { - if (ioctl(ctx->io_s, SIOCDIFPHYADDR, &ifr) < 0) + if (ioctl_ctx(ctx, SIOCDIFPHYADDR, &ifr) < 0) err(1, "SIOCDIFPHYADDR"); } @@ -1335,7 +1335,7 @@ setifbroadaddr(if_ctx *ctx, const char *addr, int dummy __unused) } static void -notealias(if_ctx *ctx, const char *addr, int param) +notealias(if_ctx *ctx, const char *addr __unused, int param) { const struct afswtch *afp = ctx->afp; @@ -1515,11 +1515,11 @@ setifpcp(if_ctx *ctx, const char *val, int arg __unused) } static void -disableifpcp(if_ctx *ctx, const char *val, int arg __unused) +disableifpcp(if_ctx *ctx, const char *val __unused, int arg __unused) { ifr.ifr_lan_pcp = IFNET_PCP_NONE; - if (ioctl(ctx->io_s, SIOCSLANPCP, (caddr_t)&ifr) == -1) + if (ioctl_ctx(ctx, SIOCSLANPCP, (caddr_t)&ifr) == -1) err(1, "SIOCSLANPCP"); } @@ -1569,7 +1569,7 @@ setifdescr(if_ctx *ctx, const char *val, int dummy __unused) } static void -unsetifdescr(if_ctx *ctx, const char *val, int value) +unsetifdescr(if_ctx *ctx, const char *val __unused, int value __unused) { setifdescr(ctx, "", 0); } @@ -1858,7 +1858,7 @@ printb(const char *s, unsigned v, const char *bits) } void -print_vhid(const struct ifaddrs *ifa, const char *s) +print_vhid(const struct ifaddrs *ifa) { struct if_data *ifd; diff --git a/sbin/ifconfig/ifconfig.h b/sbin/ifconfig/ifconfig.h index 9747c125746c..7001725543d8 100644 --- a/sbin/ifconfig/ifconfig.h +++ b/sbin/ifconfig/ifconfig.h @@ -294,7 +294,7 @@ uint32_t if_nametoindex_nl(struct snl_state *ss, const char *ifname); */ struct ifmediareq *ifmedia_getstate(if_ctx *ctx); -void print_vhid(const struct ifaddrs *, const char *); +void print_vhid(const struct ifaddrs *); void ifcreate_ioctl(if_ctx *ctx, struct ifreq *ifr);