2
0
mirror of https://github.com/openvswitch/ovs synced 2025-09-02 15:25:22 +00:00

lib/classifier: Change local variable names.

These stylistic changes makes the following patch a bit simpler.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
This commit is contained in:
Jarno Rajahalme
2014-07-18 02:24:26 -07:00
parent e48eccd133
commit 27ce650ff6

View File

@@ -1998,32 +1998,33 @@ trie_lookup_value(const rcu_trie_ptr *trie, const ovs_be32 value[],
unsigned int n_bits, unsigned int *checkbits) unsigned int n_bits, unsigned int *checkbits)
{ {
const struct trie_node *node = ovsrcu_get(struct trie_node *, trie); const struct trie_node *node = ovsrcu_get(struct trie_node *, trie);
unsigned int ofs = 0, match_len = 0; unsigned int match_len = 0, rules_at = 0;
const struct trie_node *prev = NULL; const struct trie_node *prev = NULL;
for (; node; prev = node, node = trie_next_node(node, value, ofs)) { for (; node; prev = node, node = trie_next_node(node, value, match_len)) {
unsigned int eqbits; unsigned int eqbits;
/* Check if this edge can be followed. */ /* Check if this edge can be followed. */
eqbits = prefix_equal_bits(node->prefix, node->n_bits, value, ofs); eqbits = prefix_equal_bits(node->prefix, node->n_bits, value,
ofs += eqbits; match_len);
match_len += eqbits;
if (eqbits < node->n_bits) { /* Mismatch, nothing more to be found. */ if (eqbits < node->n_bits) { /* Mismatch, nothing more to be found. */
/* Bit at offset 'ofs' differed. */ /* Bit at offset 'match_len' differed. */
*checkbits = ofs + 1; /* Includes the first mismatching bit. */ *checkbits = match_len + 1; /* Includes the mismatching bit. */
return match_len; return rules_at;
} }
/* Full match, check if rules exist at this prefix length. */ /* Full match, check if rules exist at this prefix length. */
if (node->n_rules > 0) { if (node->n_rules > 0) {
match_len = ofs; rules_at = match_len;
} }
if (ofs >= n_bits) { if (match_len >= n_bits) {
*checkbits = n_bits; /* Full prefix. */ *checkbits = n_bits; /* Full prefix. */
return match_len; return rules_at;
} }
} }
/* node == NULL. Full match so far, but we came to a dead end. /* node == NULL. Full match so far, but we came to a dead end.
* need to exclude the other branch if it exists. */ * need to exclude the other branch if it exists. */
*checkbits = !prev || trie_is_leaf(prev) ? ofs : ofs + 1; *checkbits = !prev || trie_is_leaf(prev) ? match_len : match_len + 1;
return match_len; return rules_at;
} }
static unsigned int static unsigned int