]> git.karo-electronics.de Git - karo-tx-linux.git/commit
staging: ks7010: move check and break to top of loop
authorTobin C. Harding <me@tobin.cc>
Mon, 10 Apr 2017 03:16:01 +0000 (13:16 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Apr 2017 14:14:33 +0000 (16:14 +0200)
commitd317d054b14df4cbce5324454925dc6c9858a8c4
treed6208e0cf1cb1a6373d3a47d46591e6055f87309
parenteb8c4e546961cbdb7d448458c24dfae9d1622510
staging: ks7010: move check and break to top of loop

Function uses an if statement within a for loop to guard a block of
code. If 'if' statement conditional evaluates to false, loop breaks. The
same logic can be expressed by inverting the conditional and breaking
when new conditional evaluates to true. This allows the subsequent code
to be indented one level less, aiding readability. Reduced indentation
also allows for the code to be laid out more clearly and fixes two
checkpatch warnings.

Invert if statement conditional, break from for loop if new
conditional evaluates to true. Reduce indentation in subsequent code,
fix whitespace issues. Do not change program logic.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ks7010/ks_hostif.c