diff options
author | Ying Xue <ying.xue@windriver.com> | 2014-03-27 12:54:34 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-03-27 13:08:37 -0400 |
commit | f47de12b06c95cfc38c1c79986210c7620f264c4 (patch) | |
tree | 93689afb676155b5f71aee2cc91423cde9e56c76 /net/tipc/bearer.c | |
parent | 3874ccbba80f3b3127e94b1e055fb3d502a44718 (diff) | |
download | linux-f47de12b06c95cfc38c1c79986210c7620f264c4.tar.bz2 |
tipc: remove active flag from tipc_bearer structure
After the allocation of tipc_bearer structure instance is converted
from statical way to dynamical way, we identify whether a certain
tipc_bearer structure pointer is valid by checking whether the pointer
is NULL or not. So the active flag in tipc_bearer structure becomes
redundant.
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/bearer.c')
-rw-r--r-- | net/tipc/bearer.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index 7ff98efd4890..826b7010ab69 100644 --- a/net/tipc/bearer.c +++ b/net/tipc/bearer.c @@ -179,7 +179,7 @@ struct tipc_bearer *tipc_bearer_find(const char *name) for (i = 0; i < MAX_BEARERS; i++) { b_ptr = bearer_list[i]; - if (b_ptr && b_ptr->active && (!strcmp(b_ptr->name, name))) + if (b_ptr && (!strcmp(b_ptr->name, name))) return b_ptr; } return NULL; @@ -204,7 +204,7 @@ struct sk_buff *tipc_bearer_get_names(void) b = bearer_list[j]; if (!b) continue; - if (b->active && (b->media == media_info_array[i])) { + if (b->media == media_info_array[i]) { tipc_cfg_append_tlv(buf, TIPC_TLV_BEARER_NAME, b->name, strlen(b->name) + 1); @@ -288,7 +288,7 @@ restart: with_this_prio = 1; for (i = MAX_BEARERS; i-- != 0; ) { b_ptr = bearer_list[i]; - if (!b_ptr || !b_ptr->active) { + if (!b_ptr) { bearer_id = i; continue; } @@ -333,7 +333,6 @@ restart: b_ptr->tolerance = m_ptr->tolerance; b_ptr->window = m_ptr->window; b_ptr->net_plane = bearer_id + 'A'; - b_ptr->active = 1; b_ptr->priority = priority; res = tipc_disc_create(b_ptr, &b_ptr->bcast_addr, disc_domain); @@ -628,7 +627,7 @@ void tipc_bearer_stop(void) for (i = 0; i < MAX_BEARERS; i++) { b_ptr = bearer_list[i]; - if (b_ptr && b_ptr->active) { + if (b_ptr) { bearer_disable(b_ptr, true); bearer_list[i] = NULL; } |