summaryrefslogtreecommitdiff
path: root/lib/mpi/mpiutil.c
diff options
context:
space:
mode:
authorGavin Shan <gwshan@linux.vnet.ibm.com>2016-10-21 03:47:43 +0300
committerJoel Stanley <joel@jms.id.au>2016-10-21 04:37:00 +0300
commit1bbee7bbaa429b18a9023dac8e5c04cfad275051 (patch)
treec75f6264559ca4c06a8005e03df7313805d4944f /lib/mpi/mpiutil.c
parentc5030bafe019335e2d72861024eee1c2baa34619 (diff)
downloadlinux-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