]> git.baikalelectronics.ru Git - kernel.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)
commit48a8bb6dd975df42d7f0baedcc10061cf4f5c52e
treee9be9bb4c1c32f7c121f5fa2a84906e007739bde
parentddfeddd2b7366f882b7f0760ef377fe3b146b5d7
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