[PATCH 00/25] staging: ks7010: checkpatch clean up

Tobin C. Harding me at tobin.cc
Fri Mar 31 01:18:08 UTC 2017


The purpose of this patch series is to remove all the remaining
*trivial* checkpatch errors, warnings, and checks from the ks7010
driver.

Series does not remove warnings generated by DPRINTK statements,
does not fully tidy up the comments, and does not touch line over 80
warnings of any sort.

The first three patches were the only ones I felt may cause
controversy so they are up the front to ease review.

Patch 01 removes an unnecessary function parameter on a function with
internal linkage.

Patch 02 changes a parameter type on a function with
internal linkage in order to remove unneeded void * casting.

Patch 03 adds BUG_ON to assert argument is passed into function
with a sane value, function has internal linkage and parameter is
programmer generated so this is defensive programming for future
development.

Patch 04 renames an identifier used for error return value, rc -> ret.

Patch 05 renames identifier used for the same purpose, retval -> ret.

Patch 06 refactors a number of functions in ks7010_sdio.c by inverting
if statement conditionals and reducing the level of indentation in the
code. Patch fixes whitespace issues that effect the code being touched
at the same time.

Patch 07 changes the return type on a function with internal linkage,
int to void, since it is unused and unneeded.

Patch 08 separates logical continuations that are not related into
separate statements.

Patch 09 adds a goto label so as to put function clean up code in one
place at the end of the function.

Patch 10 factors out a compound statement into a separate function.

Patch 11 removes non-accessible paths of execution from a multi-way
decision.

Patch 12 moves a null pointer check to before the first dereference.

Patch 13 simplifies calls to memcpy by defining a local variable.

Patch 14 simplifies code within a function by using an existing local
variable.

Patch 15 fixes checkpatch parenthesis alignment issues.

Patch 16 removes unnecessary else statements, fixes checkpatch warning.

Patch 17 simplifies a complex logical continuation by defining a local
variable.

Patch 18 renames an identifier so as not to use camel case.

Patch 19 adds a TODO list item in regards to the Michael MIC
algorithm.

Patch 20 renames identifier 'packet' to 'skb' inline with typical
kernel networking code.

Patch 21 fixes checkpatch logical continuation warnings.

Patch 22 removes multiple line dereferences.

Patch 23 removes an unused macro.

Patch 24 adds a goto label and uses goto statements to replace a
multi-way decision.

Patch 25 cleans code block by inverting if statement conditional and
breaking from loop if new conditional evaluates to true, reducing the
subsequent code indentation level and clearing a couple of checkpatch
warnings.

Code is untested. Builds on x86_64 and PowerPC.

Tobin C. Harding (25):
  staging: ks7010: remove unnecessary function parameter
  staging: ks7010: remove void * cast
  staging: ks7010: add BUG_ON() to catch programmer error
  staging: ks7010: rename identifier rc to ret
  staging: ks7010: rename identifier retval to ret
  staging: ks7010: invert conditional, reduce indentation
  staging: ks7010: change static function return type
  staging: ks7010: separate dissimilar checks
  staging: ks7010: fix function return code path
  staging: ks7010: factor out send stop request
  staging: ks7010: fix multi-way decision
  staging: ks7010: move null check before dereference
  staging: ks7010: simplify calls to memcpy()
  staging: ks7010: utilize local variable
  staging: ks7010: fix checkpatch PARENTHESIS_ALIGNMENT
  staging: ks7010: fix checkpatch UNNECESSARY_ELSE
  staging: ks7010: simplify complex logical statment
  staging: ks7010: rename RecvMIC to recv_mic
  staging: ks7010: add task to TODO file
  staging: ks7010: rename identifier packet to skb
  staging: ks7010: fix checkpatch LOGICAL_CONTINUATIONS
  staging: ks7010: fix checkpatch MULTILINE_DEREFERENCE
  staging: ks7010: remove unused macro
  staging: ks7010: remove multi-way decision
  staging: ks7010: move check and break to top of loop

 drivers/staging/ks7010/TODO          |   1 +
 drivers/staging/ks7010/ks7010_sdio.c | 326 +++++++++++++++++------------------
 drivers/staging/ks7010/ks_hostif.c   | 210 +++++++++++-----------
 drivers/staging/ks7010/ks_hostif.h   |   2 +-
 drivers/staging/ks7010/ks_wlan_net.c | 102 +++++------
 5 files changed, 305 insertions(+), 336 deletions(-)

-- 
2.7.4



More information about the devel mailing list