]> git.baikalelectronics.ru Git - kernel.git/commit
net/ncsi: Avoid if statements in ncsi_suspend_channel()
authorGavin Shan <gwshan@linux.vnet.ibm.com>
Thu, 20 Oct 2016 00:45:49 +0000 (11:45 +1100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 Oct 2016 15:23:07 +0000 (11:23 -0400)
commit8fb145185a0d1e9151b256387227331c3dd6d279
tree26ab3d17d37851252621eeef0ea7d332dfd0ed9a
parentf47636c2a6611240b6736a7104e930161d646740
net/ncsi: Avoid if statements in ncsi_suspend_channel()

There are several if/else statements in the state machine implemented
by switch/case in ncsi_suspend_channel() to avoid duplicated code. It
makes the code a bit hard to be understood.

This drops if/else statements in ncsi_suspend_channel() to improve the
code readability as Joel Stanley suggested. Also, it becomes easy to
add more states in the state machine without affecting current code.
No logical changes introduced by this.

Suggested-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ncsi/ncsi-manage.c