diff options
author | Gavin Shan <gwshan@linux.vnet.ibm.com> | 2016-10-21 03:47:43 +0300 |
---|---|---|
committer | Joel Stanley <joel@jms.id.au> | 2016-10-21 04:37:00 +0300 |
commit | 1bbee7bbaa429b18a9023dac8e5c04cfad275051 (patch) | |
tree | c75f6264559ca4c06a8005e03df7313805d4944f /lib/mpi/mpiutil.c | |
parent | c5030bafe019335e2d72861024eee1c2baa34619 (diff) | |
download | linux-1bbee7bbaa429b18a9023dac8e5c04cfad275051.tar.xz |
net/ncsi: Avoid if statements in ncsi_suspend_dev()
There are several if/else statements in the state machine implemented
by switch/case in ncsi_suspend_dev() to avoid duplicated code. It
makes the code a bit hard to be understood.
This drops if/else statements in ncsi_suspend_dev() 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.
Comparing to the original patch, this also drops the tag "done" in
ncsi_suspend_dev(). The code path covered by the tag is replaced
by newly introduced tag "error".
Suggested-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Diffstat (limited to 'lib/mpi/mpiutil.c')
0 files changed, 0 insertions, 0 deletions