ipfw: Remove set but unused variables.

Reported by:	GCC
Differential Revision:	https://reviews.freebsd.org/D40654
This commit is contained in:
John Baldwin 2023-06-27 10:19:32 -07:00
parent a7f25f141a
commit f5e7330633
6 changed files with 7 additions and 14 deletions

View file

@ -1074,7 +1074,6 @@ nat_foreach(nat_cb_t *f, void *arg, int sort)
struct nat44_cfg_nat *cfg;
size_t sz;
uint32_t i;
int error;
/* Start with reasonable default */
sz = sizeof(*olh) + 16 * sizeof(struct nat44_cfg_nat);
@ -1097,7 +1096,7 @@ nat_foreach(nat_cb_t *f, void *arg, int sort)
cfg = (struct nat44_cfg_nat*)(olh + 1);
for (i = 0; i < olh->count; i++) {
error = f(cfg, arg); /* Ignore errors for now */
(void)f(cfg, arg); /* Ignore errors for now */
cfg = (struct nat44_cfg_nat *)((caddr_t)cfg +
olh->objsize);
}

View file

@ -505,7 +505,6 @@ nat64clat_foreach(nat64clat_cb_t *f, const char *name, uint8_t set, int sort)
ipfw_nat64clat_cfg *cfg;
size_t sz;
uint32_t i;
int error;
/* Start with reasonable default */
sz = sizeof(*olh) + 16 * sizeof(*cfg);
@ -528,7 +527,7 @@ nat64clat_foreach(nat64clat_cb_t *f, const char *name, uint8_t set, int sort)
cfg = (ipfw_nat64clat_cfg *)(olh + 1);
for (i = 0; i < olh->count; i++) {
error = f(cfg, name, set); /* Ignore errors for now */
(void)f(cfg, name, set); /* Ignore errors for now */
cfg = (ipfw_nat64clat_cfg *)((caddr_t)cfg +
olh->objsize);
}

View file

@ -853,7 +853,6 @@ nat64lsn_foreach(nat64lsn_cb_t *f, const char *name, uint8_t set, int sort)
ipfw_nat64lsn_cfg *cfg;
size_t sz;
uint32_t i;
int error;
/* Start with reasonable default */
sz = sizeof(*olh) + 16 * sizeof(ipfw_nat64lsn_cfg);
@ -877,7 +876,7 @@ nat64lsn_foreach(nat64lsn_cb_t *f, const char *name, uint8_t set, int sort)
cfg = (ipfw_nat64lsn_cfg *)(olh + 1);
for (i = 0; i < olh->count; i++) {
error = f(cfg, name, set); /* Ignore errors for now */
(void)f(cfg, name, set); /* Ignore errors for now */
cfg = (ipfw_nat64lsn_cfg *)((caddr_t)cfg +
olh->objsize);
}

View file

@ -521,7 +521,6 @@ nat64stl_foreach(nat64stl_cb_t *f, const char *name, uint8_t set, int sort)
ipfw_nat64stl_cfg *cfg;
size_t sz;
uint32_t i;
int error;
/* Start with reasonable default */
sz = sizeof(*olh) + 16 * sizeof(*cfg);
@ -544,7 +543,7 @@ nat64stl_foreach(nat64stl_cb_t *f, const char *name, uint8_t set, int sort)
cfg = (ipfw_nat64stl_cfg *)(olh + 1);
for (i = 0; i < olh->count; i++) {
error = f(cfg, name, set); /* Ignore errors for now */
(void)f(cfg, name, set); /* Ignore errors for now */
cfg = (ipfw_nat64stl_cfg *)((caddr_t)cfg +
olh->objsize);
}

View file

@ -420,7 +420,6 @@ nptv6_foreach(nptv6_cb_t *f, const char *name, uint8_t set, int sort)
ipfw_nptv6_cfg *cfg;
size_t sz;
uint32_t i;
int error;
/* Start with reasonable default */
sz = sizeof(*olh) + 16 * sizeof(*cfg);
@ -442,7 +441,7 @@ nptv6_foreach(nptv6_cb_t *f, const char *name, uint8_t set, int sort)
cfg = (ipfw_nptv6_cfg *)(olh + 1);
for (i = 0; i < olh->count; i++) {
error = f(cfg, name, set);
(void)f(cfg, name, set);
cfg = (ipfw_nptv6_cfg *)((caddr_t)cfg + olh->objsize);
}
free(olh);

View file

@ -1408,7 +1408,6 @@ guess_key_type(char *key, uint8_t *ptype)
{
char *p;
struct in6_addr addr;
uint32_t kv;
if (ishexnumber(*key) != 0 || *key == ':') {
/* Remove / if exists */
@ -1424,7 +1423,7 @@ guess_key_type(char *key, uint8_t *ptype)
} else {
/* Port or any other key */
/* Skip non-base 10 entries like 'fa1' */
kv = strtol(key, &p, 10);
(void)strtol(key, &p, 10);
if (*p == '\0') {
*ptype = IPFW_TABLE_NUMBER;
return (0);
@ -1712,7 +1711,6 @@ tables_foreach(table_cb_t *f, void *arg, int sort)
ipfw_xtable_info *info;
size_t sz;
uint32_t i;
int error;
/* Start with reasonable default */
sz = sizeof(*olh) + 16 * sizeof(ipfw_xtable_info);
@ -1737,7 +1735,7 @@ tables_foreach(table_cb_t *f, void *arg, int sort)
info = (ipfw_xtable_info *)(olh + 1);
for (i = 0; i < olh->count; i++) {
if (g_co.use_set == 0 || info->set == g_co.use_set - 1)
error = f(info, arg);
(void)f(info, arg);
info = (ipfw_xtable_info *)((caddr_t)info +
olh->objsize);
}