tc: remove stale code

remove unused #define and "ok" statements.

Signed-off-by: Florian Westphal <fwestphal@astaro.com>
This commit is contained in:
Florian Westphal 2010-01-12 21:45:01 +01:00 committed by Stephen Hemminger
parent ddf216c863
commit 8d8de1139c
20 changed files with 1 additions and 45 deletions

View File

@ -31,8 +31,6 @@ static void explain(void)
fprintf(stderr, "\nNOTE: CLASSID is parsed as hexadecimal input.\n"); fprintf(stderr, "\nNOTE: CLASSID is parsed as hexadecimal input.\n");
} }
#define usage() return(-1)
static int fw_parse_opt(struct filter_util *qu, char *handle, int argc, char **argv, struct nlmsghdr *n) static int fw_parse_opt(struct filter_util *qu, char *handle, int argc, char **argv, struct nlmsghdr *n)
{ {
struct tc_police tp; struct tc_police tp;

View File

@ -34,8 +34,6 @@ static void explain(void)
fprintf(stderr, "\nNOTE: CLASSID is parsed as hexadecimal input.\n"); fprintf(stderr, "\nNOTE: CLASSID is parsed as hexadecimal input.\n");
} }
#define usage() return(-1)
static int route_parse_opt(struct filter_util *qu, char *handle, int argc, char **argv, struct nlmsghdr *n) static int route_parse_opt(struct filter_util *qu, char *handle, int argc, char **argv, struct nlmsghdr *n)
{ {
struct tc_police tp; struct tc_police tp;

View File

@ -37,8 +37,6 @@ static void explain(void)
fprintf(stderr, "\nNOTE: CLASSID is parsed as hexadecimal input.\n"); fprintf(stderr, "\nNOTE: CLASSID is parsed as hexadecimal input.\n");
} }
#define usage() return(-1)
int get_addr_and_pi(int *argc_p, char ***argv_p, inet_prefix * addr, int get_addr_and_pi(int *argc_p, char ***argv_p, inet_prefix * addr,
struct tc_rsvp_pinfo *pinfo, int dir, int family) struct tc_rsvp_pinfo *pinfo, int dir, int family)
{ {

View File

@ -24,10 +24,6 @@ static void explain(void)
"[ police POLICE_SPEC ]\n"); "[ police POLICE_SPEC ]\n");
} }
#define usage() return(-1)
static int tcindex_parse_opt(struct filter_util *qu, char *handle, int argc, static int tcindex_parse_opt(struct filter_util *qu, char *handle, int argc,
char **argv, struct nlmsghdr *n) char **argv, struct nlmsghdr *n)
{ {

View File

@ -45,8 +45,6 @@ static void explain(void)
fprintf(stderr, "\nNOTE: CLASSID is parsed at hexadecimal input.\n"); fprintf(stderr, "\nNOTE: CLASSID is parsed at hexadecimal input.\n");
} }
#define usage() return(-1)
int get_u32_handle(__u32 *handle, const char *str) int get_u32_handle(__u32 *handle, const char *str)
{ {
__u32 htid=0, hash=0, nodeid=0; __u32 htid=0, hash=0, nodeid=0;

View File

@ -26,8 +26,6 @@
#define MAX_HDR_LEN 64 #define MAX_HDR_LEN 64
#define usage() return(-1)
static int atm_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n) static int atm_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
{ {

View File

@ -46,7 +46,6 @@ static void explain1(char *arg)
fprintf(stderr, "Illegal \"%s\"\n", arg); fprintf(stderr, "Illegal \"%s\"\n", arg);
} }
#define usage() return(-1)
static int cbq_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n) static int cbq_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
{ {
@ -319,7 +318,7 @@ static int cbq_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, str
NEXT_ARG(); NEXT_ARG();
if (get_tc_classid(&fopt.split, *argv)) { if (get_tc_classid(&fopt.split, *argv)) {
fprintf(stderr, "Invalid split node ID.\n"); fprintf(stderr, "Invalid split node ID.\n");
usage(); return -1;
} }
fopt_ok++; fopt_ok++;
} else if (matches(*argv, "defmap") == 0) { } else if (matches(*argv, "defmap") == 0) {

View File

@ -33,7 +33,6 @@ static void explain2(void)
fprintf(stderr, "Usage: ... drr quantum SIZE\n"); fprintf(stderr, "Usage: ... drr quantum SIZE\n");
} }
#define usage() return(-1)
static int drr_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n) static int drr_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
{ {

View File

@ -19,9 +19,6 @@
#include "tc_util.h" #include "tc_util.h"
#define usage() return(-1)
static void explain(void) static void explain(void)
{ {
fprintf(stderr,"Usage: dsmark indices INDICES [ default_index " fprintf(stderr,"Usage: dsmark indices INDICES [ default_index "

View File

@ -28,8 +28,6 @@ static void explain(void)
fprintf(stderr, "Usage: ... [p|b]fifo [ limit NUMBER ]\n"); fprintf(stderr, "Usage: ... [p|b]fifo [ limit NUMBER ]\n");
} }
#define usage() return(-1)
static int fifo_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n) static int fifo_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
{ {
int ok=0; int ok=0;

View File

@ -46,8 +46,6 @@ static void explain(void)
"[grio]\n"); "[grio]\n");
} }
#define usage() return(-1)
static int init_gred(struct qdisc_util *qu, int argc, char **argv, static int init_gred(struct qdisc_util *qu, int argc, char **argv,
struct nlmsghdr *n) struct nlmsghdr *n)
{ {

View File

@ -58,8 +58,6 @@ static void explain1(char *arg)
} }
#define usage() return(-1)
static int htb_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n) static int htb_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
{ {
struct tc_htb_glob opt; struct tc_htb_glob opt;

View File

@ -32,8 +32,6 @@ static void explain(void)
fprintf(stderr, "Usage: ... ingress \n"); fprintf(stderr, "Usage: ... ingress \n");
} }
#define usage() return(-1)
static int ingress_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n) static int ingress_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
{ {

View File

@ -41,8 +41,6 @@ static void explain(void)
fprintf(stderr, "Usage: ... multiq [help]\n"); fprintf(stderr, "Usage: ... multiq [help]\n");
} }
#define usage() return(-1)
static int multiq_parse_opt(struct qdisc_util *qu, int argc, char **argv, static int multiq_parse_opt(struct qdisc_util *qu, int argc, char **argv,
struct nlmsghdr *n) struct nlmsghdr *n)
{ {

View File

@ -42,8 +42,6 @@ static void explain1(const char *arg)
fprintf(stderr, "Illegal \"%s\"\n", arg); fprintf(stderr, "Illegal \"%s\"\n", arg);
} }
#define usage() return(-1)
/* Upper bound on size of distribution /* Upper bound on size of distribution
* really (TCA_BUF_MAX - other headers) / sizeof (__s16) * really (TCA_BUF_MAX - other headers) / sizeof (__s16)
*/ */

View File

@ -28,11 +28,8 @@ static void explain(void)
fprintf(stderr, "Usage: ... prio bands NUMBER priomap P1 P2...[multiqueue]\n"); fprintf(stderr, "Usage: ... prio bands NUMBER priomap P1 P2...[multiqueue]\n");
} }
#define usage() return(-1)
static int prio_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n) static int prio_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
{ {
int ok=0;
int pmap_mode = 0; int pmap_mode = 0;
int idx = 0; int idx = 0;
struct tc_prio_qopt opt={3,{ 1, 2, 2, 2, 1, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 }}; struct tc_prio_qopt opt={3,{ 1, 2, 2, 2, 1, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 }};
@ -48,7 +45,6 @@ static int prio_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct n
fprintf(stderr, "Illegal \"bands\"\n"); fprintf(stderr, "Illegal \"bands\"\n");
return -1; return -1;
} }
ok++;
} else if (strcmp(*argv, "priomap") == 0) { } else if (strcmp(*argv, "priomap") == 0) {
if (pmap_mode) { if (pmap_mode) {
fprintf(stderr, "Error: duplicate priomap\n"); fprintf(stderr, "Error: duplicate priomap\n");

View File

@ -31,8 +31,6 @@ static void explain(void)
fprintf(stderr, " probability PROBABILITY bandwidth KBPS [ ecn ]\n"); fprintf(stderr, " probability PROBABILITY bandwidth KBPS [ ecn ]\n");
} }
#define usage() return(-1)
static int red_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n) static int red_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
{ {
struct tc_red_qopt opt; struct tc_red_qopt opt;

View File

@ -28,11 +28,9 @@ static void explain(void)
fprintf(stderr, "Usage: ... rr bands NUMBER priomap P1 P2... [multiqueue]\n"); fprintf(stderr, "Usage: ... rr bands NUMBER priomap P1 P2... [multiqueue]\n");
} }
#define usage() return(-1)
static int rr_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n) static int rr_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
{ {
int ok = 0;
int pmap_mode = 0; int pmap_mode = 0;
int idx = 0; int idx = 0;
struct tc_prio_qopt opt={3,{ 1, 2, 2, 2, 1, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 }}; struct tc_prio_qopt opt={3,{ 1, 2, 2, 2, 1, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 }};
@ -48,7 +46,6 @@ static int rr_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlm
fprintf(stderr, "Illegal \"bands\"\n"); fprintf(stderr, "Illegal \"bands\"\n");
return -1; return -1;
} }
ok++;
} else if (strcmp(*argv, "priomap") == 0) { } else if (strcmp(*argv, "priomap") == 0) {
if (pmap_mode) { if (pmap_mode) {
fprintf(stderr, "Error: duplicate priomap\n"); fprintf(stderr, "Error: duplicate priomap\n");

View File

@ -28,8 +28,6 @@ static void explain(void)
fprintf(stderr, "Usage: ... sfq [ limit NUMBER ] [ perturb SECS ] [ quantum BYTES ]\n"); fprintf(stderr, "Usage: ... sfq [ limit NUMBER ] [ perturb SECS ] [ quantum BYTES ]\n");
} }
#define usage() return(-1)
static int sfq_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n) static int sfq_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
{ {
int ok=0; int ok=0;

View File

@ -36,8 +36,6 @@ static void explain1(char *arg)
} }
#define usage() return(-1)
static int tbf_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n) static int tbf_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
{ {
int ok=0; int ok=0;