[PATCH v2 00/12] refactor hostif_data_indication()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Checkpatch emits a bunch of checkpatch warnings, errors and
checks when parsing ks_hostif.c and ks_hostif.h. We can remove a number
of these by refactoring hostif_data_indication(). Function contains a
chunk of code for handling WPA, this is a good target for refactoring.

The First five patches of this set do general clean up, fixing various
checkpatch warnings along the way.

Patch 01 fixes checkpatch warnings/errors relating to misplaced spaces.

Patch 02, 03, and 04 fix a single checkpatch warning per patch. If
necessary a patch may touch both the header and the source file in
order to group patches by warning type.

Starting at patch 06 effort is applied to cleaning up the function
hostif_data_indication().

Patch 06 refactors WPA code into a separate function, this is a cut
and paste with additional code added to pass compilation.

Patch 07 reduces the level of indentation in the new function.

Patch 08 fixes a spelling mistake in various symbols.

Patch 09 renames two buffers with more meaningful names.

Patch 10 adds two variables to reduce complex access of deeply nested
data structures.

Patch 11 does whitespace refactor taking advantage of the changes
made in the previous patches.

Patch 12 removes a line over 80 warning.

Patch set has not been tested. ks_hostif.c with set applied has been
checked with checkpatch.pl, Smatch, and Sparse. Program logic is not
modified at any stage of the series. Each patch in the series has been
applied and built in succession on both x86_64 and PowerPC.

Patch 06 introduces 4 new Sparse warning: cast to restricted __be16,
this is caused by the call

	unsigned short eth_proto;
        ...
	eth_proto = ntohs(eth_hdr->h_proto);

Same warnings are generated for the original function pre refactoring,
however now we make this call twice.

v1 -> v2:
 - Fix typo in patch 8 
 - Fix pointer dereference in patch 10

Tobin C. Harding (12):
  staging: ks7010: fix checkpatch whitespace warnings
  staging: ks7010: fix checkpatch CONSTANT_COMPARISON
  staging: ks7010: replace C types with kernel types
  staging: ks7010: fix spelling mistake
  staging: ks7010: remove unnecessary parenthesis
  staging: ks7010: factor out WPA code
  staging: ks7010: reduce level of indentation
  staging: ks7010: fix spelling of Michael MIC
  staging: ks7010: add meaningful buffer names
  staging: ks7010: add variables key, key_index
  staging: ks7010: refactor, improve code layout
  staging: ks7010: fix checkpatch line over 80

 drivers/staging/ks7010/ks_hostif.c   | 450 ++++++++++++++++++-----------------
 drivers/staging/ks7010/ks_hostif.h   | 352 +++++++++++++--------------
 drivers/staging/ks7010/michael_mic.c |   8 +-
 drivers/staging/ks7010/michael_mic.h |   6 +-
 4 files changed, 413 insertions(+), 403 deletions(-)

-- 
2.7.4

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux