From faa9110735a3303c9f51101d8d7654c872d975cb Mon Sep 17 00:00:00 2001 From: Jarno Rajahalme Date: Wed, 12 Aug 2015 16:00:49 -0700 Subject: [PATCH] classifier: Remove unused hash functions. Remove unused cls_rule_hash() and minimatch_hash() functions. Signed-off-by: Jarno Rajahalme Acked-by: Joe Stringer --- lib/classifier-private.h | 7 ------- lib/classifier.c | 7 ------- lib/classifier.h | 1 - 3 files changed, 15 deletions(-) diff --git a/lib/classifier-private.h b/lib/classifier-private.h index 3a150abb6..60811d0c9 100644 --- a/lib/classifier-private.h +++ b/lib/classifier-private.h @@ -424,13 +424,6 @@ minimask_hash(const struct minimask *mask, uint32_t basis) return miniflow_hash(&mask->masks, basis); } -/* Returns a hash value for 'match', given 'basis'. */ -static inline uint32_t -minimatch_hash(const struct minimatch *match, uint32_t basis) -{ - return miniflow_hash(match->flow, minimask_hash(match->mask, basis)); -} - /* Returns a hash value for the bits of range [start, end) in 'minimatch', * given 'basis'. * diff --git a/lib/classifier.c b/lib/classifier.c index 0a6855e70..d2bf770da 100644 --- a/lib/classifier.c +++ b/lib/classifier.c @@ -262,13 +262,6 @@ cls_rule_equal(const struct cls_rule *a, const struct cls_rule *b) return a->priority == b->priority && minimatch_equal(&a->match, &b->match); } -/* Returns a hash value for 'rule', folding in 'basis'. */ -uint32_t -cls_rule_hash(const struct cls_rule *rule, uint32_t basis) -{ - return minimatch_hash(&rule->match, hash_int(rule->priority, basis)); -} - /* Appends a string describing 'rule' to 's'. */ void cls_rule_format(const struct cls_rule *rule, struct ds *s) diff --git a/lib/classifier.h b/lib/classifier.h index 5ffe756b1..889dc1e58 100644 --- a/lib/classifier.h +++ b/lib/classifier.h @@ -372,7 +372,6 @@ void cls_rule_set_conjunctions(struct cls_rule *, const struct cls_conjunction *, size_t n); bool cls_rule_equal(const struct cls_rule *, const struct cls_rule *); -uint32_t cls_rule_hash(const struct cls_rule *, uint32_t basis); void cls_rule_format(const struct cls_rule *, struct ds *); bool cls_rule_is_catchall(const struct cls_rule *); bool cls_rule_is_loose_match(const struct cls_rule *rule, -- 2.20.1