[PATCH 0/6] staging: ks7010: clean up return statement code

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

 



The need for this patch set arose because driver code uses custom
integer return values to indicate function error. This is in itself
not that useful for other kernel code and also means that the source
code of each function has to be checked to see what the return code
means. Also the return codes are often positive.

In changing the return codes to use standard kernel error codes it
became apparent that a few other clean up tasks could also be
done. goto labels are inconsistent in their naming and usage. Also,
for the uber pedantic, spacing around return statements is not
uniform.

Patch 01 changes custom error codes to standard kernel error codes.

The next two patches rename all identifiers used as return code to
use the same name.

Patch 02: retval -> rc
Patch 03: ret -> rc

Patch 04 audits all goto statements and makes usage and naming uniform
across the driver.

Patch 05 refactors return statement code. Patch is whitespace
only. And it is *ouch* super pedantic.

Patch 06 removes unnecessary definition of identifiers at declaration
time.

Code is untested. Each patch applies and builds on x86_64 and
PowerPC. Tree with patch set applied was checked with Sparse and
Smatch and introduced no new warnings. Also checked with checkpatch
--strict, I don't think series introduces any new warnings (there are
a whole bunch still to go).

Tobin C. Harding (6):
  staging: ks7010: remove custom return values
  staging: ks7010: replace identifier retval with rc
  staging: ks7010: replace identifier ret with rc
  staging: ks7010: make goto label naming uniform
  staging: ks7010: clean up return statement code
  staging: ks7010: remove definition from declaration

 drivers/staging/ks7010/ks7010_sdio.c | 343 +++++++++++++++++------------------
 drivers/staging/ks7010/ks_hostif.c   |  27 ++-
 drivers/staging/ks7010/ks_wlan_net.c |  53 ++++--
 3 files changed, 222 insertions(+), 201 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