]> git.baikalelectronics.ru Git - kernel.git/commit
sctp: rework switch cases in sctp_outq_flush_data
authorMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Mon, 14 May 2018 17:34:43 +0000 (14:34 -0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 15 May 2018 02:57:15 +0000 (22:57 -0400)
commit0938afa2d73b99e8abb0d0d864fb9627294d7618
tree97b8c17a71566857c739a0519dbbb8cafbc902e9
parentd1a48fee9dfc6bed8eb2c14eb79198d031e2cefd
sctp: rework switch cases in sctp_outq_flush_data

Remove an inner one, which tended to be error prone due to the cascading
and it can be replaced by a simple if ().

Rework the outer one so that the actual flush code is not inside it. Now
we first validate if we can or cannot send data, return if not, and then
the flush code.

Suggested-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/outqueue.c