Skip to content
Commit f38b24c9 authored by Firo Yang's avatar Firo Yang Committed by David S. Miller
Browse files

fib_trie: coding style: Use pointer after check



As Alexander Duyck pointed out that:
struct tnode {
        ...
        struct key_vector kv[1];
}
The kv[1] member of struct tnode is an arry that refernced by
a null pointer will not crash the system, like this:
struct tnode *p = NULL;
struct key_vector *kv = p->kv;
As such p->kv doesn't actually dereference anything, it is simply a
means for getting the offset to the array from the pointer p.

This patch make the code more regular to avoid making people feel
odd when they look at the code.

Signed-off-by: default avatarFiro Yang <firogm@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cbab1510
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment