@@ -49,13 +49,12 @@ static int parse_vni_filter(const char *argv, struct nlmsghdr *n, int reqsize,
int group_type = AF_UNSPEC;
struct rtattr *nlvlist_e;
char *v;
- int i;
if (group && is_addrtype_inet(group))
group_type = (group->family == AF_INET) ? VXLAN_VNIFILTER_ENTRY_GROUP :
VXLAN_VNIFILTER_ENTRY_GROUP6;
- for (i = 0; vni; i++) {
+ while (vni != NULL) {
__u32 vni_start = 0, vni_end = 0;
v = strchr(vni, '-');
@@ -107,8 +107,6 @@ static int tap_del_ioctl(struct ifreq *ifr)
static int parse_args(int argc, char **argv,
struct ifreq *ifr, uid_t *uid, gid_t *gid)
{
- int count = 0;
-
memset(ifr, 0, sizeof(*ifr));
ifr->ifr_flags |= IFF_NO_PI;
@@ -187,7 +185,6 @@ static int parse_args(int argc, char **argv,
if (get_ifname(ifr->ifr_name, *argv))
invarg("\"name\" not a valid ifname", *argv);
}
- count++;
argc--; argv++;
}
@@ -627,7 +627,7 @@ static int parse_pedit(struct action_util *a, int *argc_p, char ***argv_p,
int argc = *argc_p;
char **argv = *argv_p;
- int ok = 0, iok = 0;
+ int ok = 0;
struct rtattr *tail;
while (argc > 0) {
@@ -689,7 +689,6 @@ static int parse_pedit(struct action_util *a, int *argc_p, char ***argv_p,
}
argc--;
argv++;
- iok++;
}
}
@@ -34,7 +34,6 @@ static void explain1(const char *arg, const char *val)
static int tbf_parse_opt(struct qdisc_util *qu, int argc, char **argv,
struct nlmsghdr *n, const char *dev)
{
- int ok = 0;
struct tc_tbf_qopt opt = {};
__u32 rtab[256];
__u32 ptab[256];
@@ -60,7 +59,6 @@ static int tbf_parse_opt(struct qdisc_util *qu, int argc, char **argv,
explain1("limit", *argv);
return -1;
}
- ok++;
} else if (matches(*argv, "latency") == 0) {
NEXT_ARG();
if (latency) {
@@ -75,7 +73,6 @@ static int tbf_parse_opt(struct qdisc_util *qu, int argc, char **argv,
explain1("latency", *argv);
return -1;
}
- ok++;
} else if (matches(*argv, "burst") == 0 ||
strcmp(*argv, "buffer") == 0 ||
strcmp(*argv, "maxburst") == 0) {
@@ -90,7 +87,6 @@ static int tbf_parse_opt(struct qdisc_util *qu, int argc, char **argv,
explain1(parm_name, *argv);
return -1;
}
- ok++;
} else if (strcmp(*argv, "mtu") == 0 ||
strcmp(*argv, "minburst") == 0) {
const char *parm_name = *argv;
@@ -104,7 +100,6 @@ static int tbf_parse_opt(struct qdisc_util *qu, int argc, char **argv,
explain1(parm_name, *argv);
return -1;
}
- ok++;
} else if (strcmp(*argv, "mpu") == 0) {
NEXT_ARG();
if (mpu) {
@@ -115,7 +110,6 @@ static int tbf_parse_opt(struct qdisc_util *qu, int argc, char **argv,
explain1("mpu", *argv);
return -1;
}
- ok++;
} else if (strcmp(*argv, "rate") == 0) {
NEXT_ARG();
if (rate64) {
@@ -131,7 +125,6 @@ static int tbf_parse_opt(struct qdisc_util *qu, int argc, char **argv,
explain1("rate", *argv);
return -1;
}
- ok++;
} else if (matches(*argv, "peakrate") == 0) {
NEXT_ARG();
if (prate64) {
@@ -147,7 +140,6 @@ static int tbf_parse_opt(struct qdisc_util *qu, int argc, char **argv,
explain1("peakrate", *argv);
return -1;
}
- ok++;
} else if (matches(*argv, "overhead") == 0) {
NEXT_ARG();
if (overhead) {
Building with clang and warnings enabled finds several places where variable was set but not used. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> --- bridge/vni.c | 3 +-- ip/iptuntap.c | 3 --- tc/m_pedit.c | 3 +-- tc/q_tbf.c | 8 -------- 4 files changed, 2 insertions(+), 15 deletions(-)