]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
staging: ks7010: invert conditional, reduce indentation
authorTobin C. Harding <me@tobin.cc>
Mon, 10 Apr 2017 03:15:43 +0000 (13:15 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Apr 2017 14:03:36 +0000 (16:03 +0200)
commit638a75b653c208ff86adeba8fa770685721343e9
treea7ba8aa7d456f4c9485aca2ed0bc3b81b87bfaa2
parentf717248713c9672526005fefd85d6d5bc44d8603
staging: ks7010: invert conditional, reduce indentation

A number of functions have blocks of code guarded by an if statement.

if (foo) {
        /* block of code */
}

This can, on occasion, more succinctly be expressed as

if (!foo)
return

/* block of code */

This change will mean a number of whitespace issues need to be
addressed/fixed. The diff can be a little hard to read when there are
multiple lines that are very similar (for example error return
code). Splitting the indentation reduction and the whitespace fixes
into two separate patches was not found to aid reading the
diff. Therefor we fix the whitespace issues at the same time. We need
to be very sure to not make any changes to the program logic, this is
ensured by only doing what is stated - invert the conditional, fix
whitespace.

Invert if statement conditionals. Return if new conditional evaluates
to true. Reduce level of indentation in subsequent code. Fix white
space issues.

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