]> rtime.felk.cvut.cz Git - lisovros/linux_canprio.git/commitdiff
em_canid: Fixed fake boolean value of match variable.
authorRostislav Lisovy <lisovy@gmail.com>
Thu, 28 Jun 2012 16:45:01 +0000 (18:45 +0200)
committerRostislav Lisovy <lisovy@gmail.com>
Thu, 28 Jun 2012 16:45:01 +0000 (18:45 +0200)
net/sched/em_canid.c

index f0c7c757e3a3e354d61d3b424c8f3431199be74e..f80d5ff3922d4405e91a3ff53db2e59e4789325a 100644 (file)
@@ -98,7 +98,7 @@ static int em_canid_match(struct sk_buff *skb, struct tcf_ematch *m,
 {
        struct canid_match *cm = em_canid_priv(m);
        canid_t can_id;
-       int match = false;
+       int match = 0;
        int i;
        const struct can_filter *lp;
 
@@ -108,19 +108,16 @@ static int em_canid_match(struct sk_buff *skb, struct tcf_ematch *m,
                for (i = 0, lp = cm->rules_raw;
                     i < cm->eff_rules_count; i++, lp++) {
                        if (!(((lp->can_id ^ can_id) & lp->can_mask))) {
-                               match = true;
+                               match = 1;
                                break;
                        }
                }
        } else { /* SFF */
                can_id &= CAN_SFF_MASK;
-               match = test_bit(can_id, cm->match_sff);
+               match = (test_bit(can_id, cm->match_sff) ? 1 : 0);
        }
 
-       if (match)
-               return 1;
-
-       return 0;
+       return match;
 }
 
 static int em_canid_change(struct tcf_proto *tp, void *data, int len,