From 764b3c23880e4f4637726b5b35e8e76c4036d1b7 Mon Sep 17 00:00:00 2001 From: Rostislav Lisovy Date: Wed, 5 Oct 2011 18:38:57 +0200 Subject: [PATCH] Removed debugging commands. --- net/sched/cls_canprio.c | 43 ++++++++++------------------------------- 1 file changed, 10 insertions(+), 33 deletions(-) diff --git a/net/sched/cls_canprio.c b/net/sched/cls_canprio.c index 8663edf65c0..0f95b04c60d 100644 --- a/net/sched/cls_canprio.c +++ b/net/sched/cls_canprio.c @@ -17,10 +17,6 @@ * * Some function descriptions are heavily inspired by article "Linux Network * Traffic Control -- Implementation Overview" by Werner Almesberger - * - * - * Implementation notes; - * parameter of functions named "base" is pointer to some parent element */ #include @@ -45,7 +41,7 @@ #endif #define SFF_BITMAP 1 -#undef SFF_BITMAP + /* Definition of Netlink messages */ enum { @@ -104,7 +100,6 @@ static void canprio_sff_match_add(struct canprio_rules *rls, u32 can_id, u32 can { int i; - pr_debug("%s() invoked\n", __FUNCTION__); /* Limit can_mask and can_id to SFF range to protect against write after end of array */ can_mask &= CAN_SFF_MASK; can_id &= can_mask; @@ -162,7 +157,6 @@ static int canprio_classify(struct sk_buff *skb, struct tcf_proto *tp, u32 can_id; int i; - pr_debug(" canprio_classify() invoked\n"); can_id = (u32)canprio_get_id(skb); rcu_read_lock(); @@ -198,12 +192,8 @@ static int canprio_classify(struct sk_buff *skb, struct tcf_proto *tp, #endif } - //if (r->inv_match_en) - // match = !match; - if (match) { *res = f->res; - pr_debug( " canprio_classify() match ok: ID 0x%x\n", can_id); rcu_read_unlock(); return TC_POLICE_OK; } @@ -275,7 +265,6 @@ static int canprio_set_parms(struct tcf_proto *tp, struct canprio_filter *f, struct canprio_rules *rules_tmp; int err; int i; - pr_debug("%s() invoked\n", __FUNCTION__); rules_tmp = kzalloc(sizeof(*rules_tmp), GFP_KERNEL); if (rules_tmp == NULL) @@ -289,10 +278,11 @@ static int canprio_set_parms(struct tcf_proto *tp, struct canprio_filter *f, canprio_nl_rules = nla_data(tb[TCA_CANPRIO_RULES]); rules_tmp->sff_rules_count = 0; rules_tmp->eff_rules_count = 0; - rules_tmp->rules_count = (nla_len(tb[TCA_CANPRIO_RULES]) / sizeof(struct can_filter)); - pr_debug(" rules_count = %u\n", rules_tmp->rules_count); + rules_tmp->rules_count = + (nla_len(tb[TCA_CANPRIO_RULES]) / sizeof(struct can_filter)); - rules_tmp->rules_raw = kzalloc(sizeof(struct can_filter) * rules_tmp->rules_count, GFP_KERNEL); + rules_tmp->rules_raw = + kzalloc(sizeof(struct can_filter) * rules_tmp->rules_count, GFP_KERNEL); err = -ENOMEM; if (rules_tmp->rules_raw == NULL) goto errout; @@ -305,9 +295,6 @@ static int canprio_set_parms(struct tcf_proto *tp, struct canprio_filter *f, memcpy(rules_tmp->rules_raw + rules_tmp->eff_rules_count, &canprio_nl_rules[i], sizeof(struct can_filter)); rules_tmp->eff_rules_count ++; - - pr_debug(" can ID to match = 0x%x with mask 0x%x\n", - canprio_nl_rules[i].can_id, canprio_nl_rules[i].can_mask); } else { continue; } @@ -329,9 +316,6 @@ static int canprio_set_parms(struct tcf_proto *tp, struct canprio_filter *f, canprio_sff_match_add(rules_tmp, canprio_nl_rules[i].can_id, canprio_nl_rules[i].can_mask); #endif - - pr_debug(" can ID to match = 0x%x with mask 0x%x\n", - canprio_nl_rules[i].can_id, canprio_nl_rules[i].can_mask); } } } @@ -340,9 +324,9 @@ static int canprio_set_parms(struct tcf_proto *tp, struct canprio_filter *f, if (tb[TCA_CANPRIO_INV_EN] != NULL) rules_tmp->inv_match_en = nla_get_u32(tb[TCA_CANPRIO_INV_EN]); - if (f->rules == NULL) { // Setting parameters for newly created filter + if (f->rules == NULL) { /* Setting parameters for newly created filter */ rcu_assign_pointer(f->rules, rules_tmp); - } else { // Changing existing filter + } else { /* Changing existing filter */ struct canprio_rules *rules_old; rules_old = xchg(&f->rules, rules_tmp); @@ -366,7 +350,7 @@ errout: * @base: * @handle: * @tca: Messages passed through the Netlink from userspace. - * @arg: ??? FIXME + * @arg: */ static int canprio_change(struct tcf_proto *tp, unsigned long base, u32 handle, struct nlattr **tca, unsigned long *arg) @@ -376,8 +360,6 @@ static int canprio_change(struct tcf_proto *tp, unsigned long base, u32 handle, struct nlattr *tb[TCA_CANPRIO_MAX + 1]; int err; - pr_debug("%s() invoked\n", __FUNCTION__); - if (tca[TCA_OPTIONS] == NULL) return -EINVAL; @@ -393,7 +375,6 @@ static int canprio_change(struct tcf_proto *tp, unsigned long base, u32 handle, if (handle && f->handle != handle) return -EINVAL; - pr_debug("[change existing filter]\n"); return canprio_set_parms(tp, f, base, tb, tca[TCA_RATE]); } @@ -415,12 +396,12 @@ static int canprio_change(struct tcf_proto *tp, unsigned long base, u32 handle, f->handle = canprio_gen_handle(tp); } - //Configure filter + /* Configure filter */ err = canprio_set_parms(tp, f, base, tb, tca[TCA_RATE]); if (err < 0) goto errout; - //Add newly created filter to list of all filters + /* Add newly created filter to list of all filters */ tcf_tree_lock(tp); list_add(&f->link, &head->flist); tcf_tree_unlock(tp); @@ -491,7 +472,6 @@ static int canprio_delete(struct tcf_proto *tp, unsigned long arg) static int canprio_init(struct tcf_proto *tp) { struct canprio_head *head; - pr_debug(" canprio_init invoked\n"); head = kzalloc(sizeof(*head), GFP_KERNEL); if (head == NULL) @@ -513,8 +493,6 @@ static void canprio_walk(struct tcf_proto *tp, struct tcf_walker *arg) struct canprio_head *head = (struct canprio_head *) tp->root; struct canprio_filter *f; - pr_debug("%s() invoked\n", __FUNCTION__); - list_for_each_entry(f, &head->flist, link) { if (arg->count < arg->skip) goto skip; @@ -537,7 +515,6 @@ static int canprio_dump(struct tcf_proto *tp, unsigned long fh, struct canprio_filter *f = (struct canprio_filter *) fh; struct nlattr *nest; struct canprio_rules *r; - pr_debug("%s() invoked\n", __FUNCTION__); if (f == NULL) return skb->len; -- 2.39.2