[PATCH 00/10] staging: ks7010: audit return statements
Tobin C. Harding
me at tobin.cc
Tue Mar 21 02:37:02 UTC 2017
Driver return statement code exhibits a degree of uncleanliness.
Driver return statement code is non-uniform in its use of
identifiers, both variables and goto labels.
goto statements occasionally are used with out clean up code instead
of returning directly.
Variables are defined (at declaration time) to zero unnecessarily.
Code could be cleaned up by an audit of all return statement code.
Initial patches do general checkpatch cleanups.
Patch 01, patch 02, and patch 03 are white space fixes, separated by
checkpatch type.
Patch 04 fixes unbalanced braces.
Patch 05 removes multiple line assignments.
Patch 06 removes usage of goto statements with out clean up code.
Patch 07 renames goto labels to be more informative and uniform.
Patch 08 removes not-zero comparison i.e if (foo != 0).
Patch 09 removes comparison to zero i.e if (foo == 0) if it does not
add information to the statement.
Patch 10 renames identifiers 'rc' and 'retval' to 'ret' in order to be
uniform across the driver.
Tobin C. Harding (10):
staging: ks7010: fix checkpatch LINE_SPACING
staging: ks7010: fix checkpatch SPACING
staging: ks7010: fix checkpatch PARENTHESIS_ALIGNMENT
staging: ks7010: fix checkpatch BRACES
staging: ks7010: fix checkpatch MULTIPLE_ASSIGNMENTS
staging: ks7010: return directly on error
staging: ks7010: make goto labels uniform
staging: ks7010: remove non-zero comparison
staging: ks7010: remove zero comparison
staging: ks7010: rename return value identifier
drivers/staging/ks7010/ks7010_sdio.c | 226 +++++++++++++++++------------------
drivers/staging/ks7010/ks_hostif.c | 47 ++++----
drivers/staging/ks7010/ks_wlan_net.c | 38 +++---
drivers/staging/ks7010/michael_mic.c | 4 +-
4 files changed, 155 insertions(+), 160 deletions(-)
--
2.7.4
More information about the devel
mailing list