]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tc: remove stale code
authorFlorian Westphal <fw@strlen.de>
Tue, 12 Jan 2010 20:45:01 +0000 (21:45 +0100)
committerStephen Hemminger <stephen.hemminger@vyatta.com>
Thu, 21 Jan 2010 18:13:01 +0000 (10:13 -0800)
remove unused #define and "ok" statements.

Signed-off-by: Florian Westphal <fwestphal@astaro.com>
20 files changed:
tc/f_fw.c
tc/f_route.c
tc/f_rsvp.c
tc/f_tcindex.c
tc/f_u32.c
tc/q_atm.c
tc/q_cbq.c
tc/q_drr.c
tc/q_dsmark.c
tc/q_fifo.c
tc/q_gred.c
tc/q_htb.c
tc/q_ingress.c
tc/q_multiq.c
tc/q_netem.c
tc/q_prio.c
tc/q_red.c
tc/q_rr.c
tc/q_sfq.c
tc/q_tbf.c

index cc8ea2d83e3972e240eef737462854773edf5c9e..219b404f803141a5258ecd27f179e7c8b1926c65 100644 (file)
--- a/tc/f_fw.c
+++ b/tc/f_fw.c
@@ -31,8 +31,6 @@ static void explain(void)
        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)
 {
        struct tc_police tp;
index 67dd49c0d8e262abe4c0548f4a53a9b2f1ccf4cb..eccf924b550122984eacc1db632d1b9d1ab4e713 100644 (file)
@@ -34,8 +34,6 @@ static void explain(void)
        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)
 {
        struct tc_police tp;
index 7e1e6d92ec4723cb6a3f4b821f6b602f59996542..808310df3159c3a53cee58d0224401faabe8b7b4 100644 (file)
@@ -37,8 +37,6 @@ static void explain(void)
        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,
                    struct tc_rsvp_pinfo *pinfo, int dir, int family)
 {
index 39ac75adcc1eedfc40e4d6d9082ac58aa59008a9..cb6f854cef180b32677a073471bc8e3d69901886 100644 (file)
@@ -24,10 +24,6 @@ static void explain(void)
            "[ police POLICE_SPEC ]\n");
 }
 
-
-#define usage() return(-1)
-
-
 static int tcindex_parse_opt(struct filter_util *qu, char *handle, int argc,
     char **argv, struct nlmsghdr *n)
 {
index cb3f67ea98cbcb756de2269ec716b876972b5f09..4f5f74e41f0937d9d2a1b0933a80d0783980ed40 100644 (file)
@@ -45,8 +45,6 @@ static void explain(void)
        fprintf(stderr, "\nNOTE: CLASSID is parsed at hexadecimal input.\n");
 }
 
-#define usage() return(-1)
-
 int get_u32_handle(__u32 *handle, const char *str)
 {
        __u32 htid=0, hash=0, nodeid=0;
index 4c8dc0b814c6e5ea08ed92018c3886cf71074854..eec0d77601ef309be8d02e18ed738609a1034ce5 100644 (file)
@@ -26,8 +26,6 @@
 
 #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)
 {
index c99dc3b6fbcb2d4ff4d871337a2c2ff4ba741cf8..3c5e72c143a86eebeec3d3d103d335dbc3e43c63 100644 (file)
@@ -46,7 +46,6 @@ static void explain1(char *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)
 {
@@ -319,7 +318,7 @@ static int cbq_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, str
                        NEXT_ARG();
                        if (get_tc_classid(&fopt.split, *argv)) {
                                fprintf(stderr, "Invalid split node ID.\n");
-                               usage();
+                               return -1;
                        }
                        fopt_ok++;
                } else if (matches(*argv, "defmap") == 0) {
index 7d2d874108db86891abaada03f08ff064af646d5..81de44d909a53c2223ba9d80d041fa11209669c4 100644 (file)
@@ -33,7 +33,6 @@ static void explain2(void)
        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)
 {
index cdb5bf2f3399e17d4b4e8d5e7063ba1269112887..cfbb33515ed9e0f6e06c5a4d23a1e863c5ad113c 100644 (file)
@@ -19,9 +19,6 @@
 #include "tc_util.h"
 
 
-#define usage() return(-1)
-
-
 static void explain(void)
 {
        fprintf(stderr,"Usage: dsmark indices INDICES [ default_index "
index 9f3b3eb2cd7cd96b8076529ce21d618d20b7d6e8..f561752d4d61a924cc2c5279eb32e36b8570af68 100644 (file)
@@ -28,8 +28,6 @@ static void explain(void)
        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)
 {
        int ok=0;
index ab26801d40fc2371a5039145bd0a9877564f2c40..df4aa3d8a65b5cf1bcbdb19f04fe80a8bdb04706 100644 (file)
@@ -46,8 +46,6 @@ static void explain(void)
            "[grio]\n");
 }
 
-#define usage() return(-1)
-
 static int init_gred(struct qdisc_util *qu, int argc, char **argv, 
                     struct nlmsghdr *n)
 {
index c69e350d0735a090d3e4000683c23dd0771371eb..caa47c26be8a8875cc6af8ba7482ee51bd52d1db 100644 (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)
 {
        struct tc_htb_glob opt;
index 71fbd493a8b919a29d69c35ce62dea16ce547fb6..ba58e722f8dbcd8f36d2ab0e826f89e411951a9e 100644 (file)
@@ -32,8 +32,6 @@ static void explain(void)
        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)
 {
 
index 306e170df7a171d39bbc1e74c1adf47b3a57c2f7..fce5e449862b1e3318660111994e7057ef6a577d 100644 (file)
@@ -41,8 +41,6 @@ static void explain(void)
        fprintf(stderr, "Usage: ... multiq [help]\n");
 }
 
-#define usage() return(-1)
-
 static int multiq_parse_opt(struct qdisc_util *qu, int argc, char **argv,
                            struct nlmsghdr *n)
 {
index 33b3d2a49ee9912f26d9a1c31048bd1b916cbad4..6aaaded944ce4362617ddc00a9f24cea40358db2 100644 (file)
@@ -42,8 +42,6 @@ static void explain1(const char *arg)
        fprintf(stderr, "Illegal \"%s\"\n", arg);
 }
 
-#define usage() return(-1)
-
 /* Upper bound on size of distribution 
  *  really (TCA_BUF_MAX - other headers) / sizeof (__s16)
  */
index 31a37cd84ea88c4d86967cdf3c7132760d72c520..2f54d550b0d8b470cbfac5d2e1bbfb658756ec75 100644 (file)
@@ -28,11 +28,8 @@ static void explain(void)
        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)
 {
-       int ok=0;
        int pmap_mode = 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 }};
@@ -48,7 +45,6 @@ static int prio_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct n
                                fprintf(stderr, "Illegal \"bands\"\n");
                                return -1;
                        }
-                       ok++;
                } else if (strcmp(*argv, "priomap") == 0) {
                        if (pmap_mode) {
                                fprintf(stderr, "Error: duplicate priomap\n");
index 3ba6bc74cddb4defc0204a7ba238fa23ba95117d..4b1b889365bdb931d38384e6812e340b641a6025 100644 (file)
@@ -31,8 +31,6 @@ static void explain(void)
        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)
 {
        struct tc_red_qopt opt;
index 9bb8c7de1698788e3a6fab0944b6f9a1150b015e..1ff3ac96586e942b5fccbe26d8470b4ea9bfbd0e 100644 (file)
--- a/tc/q_rr.c
+++ b/tc/q_rr.c
@@ -28,11 +28,9 @@ static void explain(void)
        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)
 {
-       int ok = 0;
        int pmap_mode = 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 }};
@@ -48,7 +46,6 @@ static int rr_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlm
                                fprintf(stderr, "Illegal \"bands\"\n");
                                return -1;
                        }
-                       ok++;
                } else if (strcmp(*argv, "priomap") == 0) {
                        if (pmap_mode) {
                                fprintf(stderr, "Error: duplicate priomap\n");
index ce4dade80c15538cd3a21c2a7001c0629d1075be..71a3c9ac16694a67195d9366c15c3f57e0fd5c5b 100644 (file)
@@ -28,8 +28,6 @@ static void explain(void)
        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)
 {
        int ok=0;
index 06ccda317ab4682ddb7f8639c9ca57c996da6b8d..dc556fe01d745fe808d0db0fe192dae5a9beb609 100644 (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)
 {
        int ok=0;