]> git.karo-electronics.de Git - karo-tx-linux.git/commit
staging: rtl8712: Invert if statements to reduce indentation level
authorNarcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>
Tue, 21 Mar 2017 22:52:40 +0000 (00:52 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Mar 2017 13:24:45 +0000 (14:24 +0100)
commite6d9379507d77c08fb9f91c8430c3f87ceb38d29
treee9be9bb4c1c32f7c121f5fa2a84906e007739bde
parentff49304b5b7b0136eb2954163dfa7c0739312169
staging: rtl8712: Invert if statements to reduce indentation level

Invert if statements to be able to return immediately in case of error,
and to avoid additional else branch, and then continue with the rest
of the function without excessive indentation.

This was found using the following Coccinelle script:

@disable neg_if@
expression e,E;
statement S;
@@

*if (e)
S
else { return -E; }

@disable neg_if@
expression e,E;
statement S;
identifier l;
@@

*if (e)
S
else { rc = -E; goto l;  }

Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8712/rtl871x_ioctl_linux.c