net: tcp: remove net_tcp_set_state() function
There are no users of net_tcp_set_state() left outside of subsys/net/ip/tcp.c. And the naming of this function is confusing -- it could easily be mistaken for net_tcp_change_state() which contains additional logic for certain tcp states. Let's remove it entirely and fix the remaining uses to set tcp->state directly. Change-Id: I92855ad180e8682780fcff11e50af06adcbc177c Signed-off-by: Michael Scott <michael.scott@linaro.org>
This commit is contained in:
parent
a96fbc8167
commit
eddd598323
2 changed files with 2 additions and 14 deletions
|
@ -172,7 +172,7 @@ struct net_tcp *net_tcp_alloc(struct net_context *context)
|
|||
memset(&tcp_context[i], 0, sizeof(struct net_tcp));
|
||||
|
||||
tcp_context[i].flags = NET_TCP_IN_USE;
|
||||
net_tcp_set_state(&tcp_context[i], NET_TCP_CLOSED);
|
||||
tcp_context[i].state = NET_TCP_CLOSED;
|
||||
tcp_context[i].context = context;
|
||||
|
||||
tcp_context[i].send_seq = init_isn();
|
||||
|
@ -854,7 +854,7 @@ void net_tcp_change_state(struct net_tcp *tcp,
|
|||
validate_state_transition(tcp->state, new_state);
|
||||
#endif /* CONFIG_NET_DEBUG_TCP */
|
||||
|
||||
net_tcp_set_state(tcp, new_state);
|
||||
tcp->state = new_state;
|
||||
|
||||
if (net_tcp_get_state(tcp) != NET_TCP_CLOSED) {
|
||||
return;
|
||||
|
|
|
@ -333,18 +333,6 @@ static inline enum net_tcp_state net_tcp_get_state(const struct net_tcp *tcp)
|
|||
return (enum net_tcp_state)tcp->state;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sets the state for a TCP context
|
||||
*
|
||||
* @param tcp TCP context
|
||||
* @param state TCP state
|
||||
*/
|
||||
static inline void net_tcp_set_state(struct net_tcp *tcp,
|
||||
enum net_tcp_state state)
|
||||
{
|
||||
tcp->state = state;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_NET_TCP)
|
||||
void net_tcp_init(void);
|
||||
#else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue