Skip to content

Commit

Permalink
classifier: Remove unused hash functions.
Browse files Browse the repository at this point in the history
Remove unused cls_rule_hash() and minimatch_hash() functions.

Signed-off-by: Jarno Rajahalme <[email protected]>
Acked-by: Joe Stringer <[email protected]>
  • Loading branch information
Jarno Rajahalme committed Aug 12, 2015
1 parent c2581cc commit faa9110
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 15 deletions.
7 changes: 0 additions & 7 deletions lib/classifier-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
*
Expand Down
7 changes: 0 additions & 7 deletions lib/classifier.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion lib/classifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit faa9110

Please sign in to comment.