[PATCH 0/2] staging: dgnc: fix return error codes

2017-03-14 Thread Tobin C. Harding
trict, Smatch, and Sparse. Series does not introduce any new warnings. Tobin C. Harding (2): staging: dgnc: make error codes uniform staging: dgnc: preserve return code drivers/staging/dgnc/dgnc_mgmt.c | 2 +- drivers/staging/dgnc/dgnc_tty.c | 50 2

[PATCH 1/2] staging: dgnc: make error codes uniform

2017-03-14 Thread Tobin C. Harding
cases of failed magic number checks. Signed-off-by: Tobin C. Harding --- drivers/staging/dgnc/dgnc_mgmt.c | 2 +- drivers/staging/dgnc/dgnc_tty.c | 44 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_mgmt.c b/dr

[PATCH 2/2] staging: dgnc: preserve return code

2017-03-14 Thread Tobin C. Harding
Return code from tty_check_change() should be being preserved. Preserve return code from call to tty_check_change(). Signed-off-by: Tobin C. Harding --- drivers/staging/dgnc/dgnc_tty.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_tty.c b

[PATCH] staging: ks7010: fix off by one error

2017-03-14 Thread Tobin C. Harding
Bug introduced in commit 7676b72 by Tobin C. Harding. Remove equals sign from comparison, fixing off by one error. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks_wlan_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ks7010/ks_wlan_net.c

Re: [PATCH] staging: ks7010: fix off by one error

2017-03-14 Thread Tobin C. Harding
On Wed, Mar 15, 2017 at 09:48:14AM +0800, Greg Kroah-Hartman wrote: > On Wed, Mar 15, 2017 at 12:01:07PM +1100, Tobin C. Harding wrote: > > Bug introduced in commit 7676b72 by Tobin C. Harding. > > > > Remove equals sign from comparison, fixing off by one error. > >

Re: [PATCH] staging: ks7010: fix off by one error

2017-03-14 Thread Tobin C. Harding
On Wed, Mar 15, 2017 at 09:48:55AM +0800, Greg Kroah-Hartman wrote: > On Wed, Mar 15, 2017 at 09:48:14AM +0800, Greg Kroah-Hartman wrote: > > On Wed, Mar 15, 2017 at 12:01:07PM +1100, Tobin C. Harding wrote: > > > Bug introduced in commit 7676b72 by Tobin C. Harding. > >

[PATCH 2/2] staging: ks7010: remove dead code

2017-03-14 Thread Tobin C. Harding
Driver has dead code compiled out using preprocessor directives. TODO file asks for these not to be removed - ignore this. Remove dead code. Remove 'do not remove #if 0/1 ...' from TODO file. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/TODO | 2 - drive

[PATCH 0/2] staging: ks7010: remove unnecessary code

2017-03-14 Thread Tobin C. Harding
dead code. Tobin C. Harding (2): staging: ks7010: remove superfluous comments staging: ks7010: remove dead code drivers/staging/ks7010/TODO | 2 - drivers/staging/ks7010/ks7010_sdio.c | 40 +--- drivers/staging/ks7010/ks_wlan_net.c | 434 +-- 3 files

[PATCH 1/2] staging: ks7010: remove superfluous comments

2017-03-14 Thread Tobin C. Harding
Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks_wlan_net.c | 137 ++- 1 file changed, 6 insertions(+), 131 deletions(-) diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c index 0852a1d..b4b7e2d 100644 --- a/drive

Re: [PATCHv5 4/4] Staging: ks7010: ks_wlan_ioctl.h: Wrap complex macros with parentheses

2017-03-14 Thread Tobin C. Harding
On Tue, Mar 14, 2017 at 07:25:54PM -0700, Matthew Giassa wrote: > Wrapping all complex macros with parentheses to resolve checkpatch > errors. This change, along with the preceding changes in this change > set, resolves all checkpatch warnings and errors for the file. > > Signed-off-by: Matthew Gi

[PATCH 1/3] staging: ks7010: fix checkpatch SPACING

2017-03-14 Thread Tobin C. Harding
Checkpatch emits WARNING: Unnecessary space before function pointer arguments. Remove unnecessary space before function pointer. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks7010_sdio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ks7010

[PATCH 0/3] staging: ks7010: clean up headers

2017-03-14 Thread Tobin C. Harding
format comments to structs and removes offending block comments. Patch 03 tidies up function prototypes. Code is untested. Series builds on x86_64 and PowerPC. Tobin C. Harding (3): staging: ks7010: fix checkpatch SPACING staging: ks7010: fix checkpatch BLOCK_COMMENT_STYLE staging: ks7010

[PATCH 3/3] staging: ks7010: fix checkpatch PARENTHESIS_ALIGNMENT

2017-03-14 Thread Tobin C. Harding
ix 5 error/warning instances. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks_hostif.h | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/staging/ks7010/ks_hostif.h b/drivers/staging/ks7010/ks_hostif.h index 46f8470..0fa7b74 100644 --- a/drive

[PATCH 2/3] staging: ks7010: fix checkpatch BLOCK_COMMENT_STYLE

2017-03-14 Thread Tobin C. Harding
Checkpatch emits WARNING: Block comments use a trailing */ on a separate line. Move comments to (kernel doc format) struct comment. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks_hostif.h | 50 ++ 1 file changed, 40 insertions(+), 10 deletions

Re: [PATCH 2/2] staging: ks7010: remove dead code

2017-03-15 Thread Tobin C. Harding
On Wed, Mar 15, 2017 at 09:00:24AM +0100, Wolfram Sang wrote: > On Wed, Mar 15, 2017 at 01:57:32PM +1100, Tobin C. Harding wrote: > > Driver has dead code compiled out using preprocessor directives. TODO > > file asks for these not to be removed - ignore this. > > Why? >

Michael MIC

2017-03-15 Thread Tobin C. Harding
Hi Wolfram, Is there some technical reason why module ks7010 includes a implementation of Michael MIC instead of using the implementation in crypto/? Or is this covered by the statement from the TODO - check what other upstream wireless mechanisms can be used instead of the custom ones here t

Re: [PATCH 2/6] staging: ks7010: replace identifier retval with rc

2017-03-15 Thread Tobin C. Harding
On Thu, Mar 16, 2017 at 11:40:47AM +0900, Greg Kroah-Hartman wrote: > On Tue, Mar 14, 2017 at 09:20:13PM +1100, Tobin C. Harding wrote: > > Code uses identifiers retval, ret, and rc all for function return > > values. It would be more readable if the whole driver used a single >

Re: [PATCH 1/2] staging: dgnc: make error codes uniform

2017-03-15 Thread Tobin C. Harding
On Thu, Mar 16, 2017 at 11:45:17AM +0900, Greg Kroah-Hartman wrote: > On Wed, Mar 15, 2017 at 10:44:28AM +1100, Tobin C. Harding wrote: > > Driver code is non-uniform in its use of error return codes, identical > > failures are returning different error codes. Return is on f

Re: [PATCH 1/2] staging: dgnc: make error codes uniform

2017-03-16 Thread Tobin C. Harding
On Thu, Mar 16, 2017 at 03:32:50PM +0900, Greg Kroah-Hartman wrote: > On Thu, Mar 16, 2017 at 03:46:58PM +1100, Tobin C. Harding wrote: > > On Thu, Mar 16, 2017 at 11:45:17AM +0900, Greg Kroah-Hartman wrote: > > > On Wed, Mar 15, 2017 at 10:44:28AM +1100, Tobin C. Harding wro

[PATCH 4/6] staging: ks7010: use le16_to_cpu for arithmetic

2017-03-16 Thread Tobin C. Harding
Code performs arithmetic using a little endian type mixed with non-endian types. This won't work on big endian architectures. Wrap little endian type in call to le16_to_cpu before doing arithmetic. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks_hostif.c | 13 ++-

[PATCH 3/6] staging: ks7010: set lval type of cpu_to_leXX()

2017-03-16 Thread Tobin C. Harding
returned by cpu_to_leXX() Change unsigned types to little endian types. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks_hostif.c | 18 drivers/staging/ks7010/ks_hostif.h | 86 +++--- 2 files changed, 52 insertions(+), 52 deletions(-) diff --git

[PATCH 2/6] staging: ks7010: change unsigned short to __be16

2017-03-16 Thread Tobin C. Harding
e16. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/eap_packet.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/ks7010/eap_packet.h b/drivers/staging/ks7010/eap_packet.h index 7a3decf..124167f 100644 --- a/drivers/staging/ks7010/eap_packet.h ++

[PATCH 0/6] staging: ks7010: fix endian issues

2017-03-16 Thread Tobin C. Harding
metic work on any architecture. Patch 05 fixes endian variable degrading to integer. Patch 06 uses le16_to_cpu() for assigning endian value to cpu type. Code has not been tested. Patch set builds on x86_64 and PowerPC. Tobin C. Harding (6): staging: ks7010: rename sk_buf ptr to skb staging: k

[PATCH 6/6] staging: ks7010: use le16_to_cpu() to queue event

2017-03-16 Thread Tobin C. Harding
Events are stored as a circular buffer of integers. An event is of type __le16, to store this in the buffer we need to convert it to the endianess of the cpu. Call le16_to_cpu() before adding event to events buffer. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks7010_sdio.c | 2

[PATCH 5/6] staging: ks7010: add endian non-specific variable

2017-03-16 Thread Tobin C. Harding
le16_to_cpu(). Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks7010_sdio.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c index 0fa13cd..6083b7e 100644 --- a/drivers

[PATCH 1/6] staging: ks7010: rename sk_buf ptr to skb

2017-03-16 Thread Tobin C. Harding
There are 8088 struct sk_buf pointers declared in the kernel under net/ of these 6670 are call skb. This is an indication that 'skb' a better identifier than 'packet' for an sk_buf pointer. Rename packet -> skb Signed-off-by: Tobin C. Harding --- drivers/staging/

Re: [PATCH 2/6] staging: ks7010: replace identifier retval with rc

2017-03-16 Thread Tobin C. Harding
On Thu, Mar 16, 2017 at 02:29:04PM +0300, Dan Carpenter wrote: > On Thu, Mar 16, 2017 at 11:40:47AM +0900, Greg Kroah-Hartman wrote: > > On Tue, Mar 14, 2017 at 09:20:13PM +1100, Tobin C. Harding wrote: > > > Code uses identifiers retval, ret, and rc all for function return >

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

2017-03-20 Thread Tobin C. Harding
On Tue, Mar 14, 2017 at 09:20:11PM +1100, Tobin C. Harding wrote: [snip] Drop this series please. (patch 1 of set already merged). thanks, Tobin. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman

[PATCH 02/10] staging: ks7010: fix checkpatch SPACING

2017-03-20 Thread Tobin C. Harding
Checkpatch emits CHECK: No space is necessary after a cast. Remove unnecessary space after cast. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/michael_mic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/ks7010/michael_mic.c b/drivers

[PATCH 05/10] staging: ks7010: fix checkpatch MULTIPLE_ASSIGNMENTS

2017-03-20 Thread Tobin C. Harding
Checkpatch emits CHECK: multiple assignments should be avoided. Move multiple line assignment to individual lines. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks_hostif.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/ks7010/ks_hostif.c b

[PATCH 00/10] staging: ks7010: audit return statements

2017-03-20 Thread Tobin C. Harding
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_AL

[PATCH 03/10] staging: ks7010: fix checkpatch PARENTHESIS_ALIGNMENT

2017-03-20 Thread Tobin C. Harding
Checkpatch emits CHECK: Alignment should match open parenthesis. Fix alignment to open parenthesis in line with kernel coding style. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks7010_sdio.c | 4 ++-- drivers/staging/ks7010/ks_wlan_net.c | 16 2 files changed

[PATCH 04/10] staging: ks7010: fix checkpatch BRACES

2017-03-20 Thread Tobin C. Harding
since it is the same statement. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks_hostif.c | 22 +- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c index db10e16..68e26f4 100644

[PATCH 01/10] staging: ks7010: fix checkpatch LINE_SPACING

2017-03-20 Thread Tobin C. Harding
Checkpatch emits CHECK: Please use a blank line after function/struct/union/enum declarations. Add blank line after function definition. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks_wlan_net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/ks7010

[PATCH 09/10] staging: ks7010: remove zero comparison

2017-03-20 Thread Tobin C. Harding
Comparison, equal to zero, is redundant 'if (foo == 0)' is equal to 'if (!foo)' Typical kernel coding style is to use the shorter form. Remove unnecessary zero comparison. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks_wlan_net.c | 4 ++-- 1 file changed

[PATCH 10/10] staging: ks7010: rename return value identifier

2017-03-20 Thread Tobin C. Harding
g 'ret' is a decent choice. Rename rc -> ret Rename retval -> ret Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks7010_sdio.c | 142 +-- drivers/staging/ks7010/ks_hostif.c | 16 ++-- drivers/staging/ks7010/ks_wlan_net.c | 1

[PATCH 07/10] staging: ks7010: make goto labels uniform

2017-03-20 Thread Tobin C. Harding
bels so as to better describe what they do. If an execution path only exists for the label on an error, prefix the label with 'err_'. If a non-error execution path exist do not use prefix. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks7010_sdio.c | 70 ++-

[PATCH 06/10] staging: ks7010: return directly on error

2017-03-20 Thread Tobin C. Harding
Function uses goto label with no clean up code. In this case we should just return directly. Remove goto statement, return directly on error. Signed-off-by: Tobin C. Harding --- '/* length check fail */' comment added because preceding line is a standard function return value check f

[PATCH 08/10] staging: ks7010: remove non-zero comparison

2017-03-20 Thread Tobin C. Harding
Comparison, does not equal zero, is redundant 'if (foo != 0)' is equal to 'if (foo)' Typical kernel coding style is to use the shorter form. Remove unnecessary non-zero comparison. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks7010_sdio.c | 4 ++-- dr

Re: [PATCH 04/10] staging: ks7010: fix checkpatch BRACES

2017-03-21 Thread Tobin C. Harding
On Tue, Mar 21, 2017 at 03:36:34PM +0300, Dan Carpenter wrote: > On Tue, Mar 21, 2017 at 01:37:06PM +1100, Tobin C. Harding wrote: > > Checkpatch emits CHECK: Unbalanced braces around else > > statement. Statements in question are single statements so we do not > > need br

Re: [PATCH 09/10] staging: ks7010: remove zero comparison

2017-03-21 Thread Tobin C. Harding
On Tue, Mar 21, 2017 at 03:49:22PM +0300, Dan Carpenter wrote: > On Tue, Mar 21, 2017 at 01:37:11PM +1100, Tobin C. Harding wrote: > > Comparison, equal to zero, is redundant > > > > 'if (foo == 0)' is equal to 'if (!foo)' > > > > T

Re: [PATCH 10/10] staging: ks7010: rename return value identifier

2017-03-21 Thread Tobin C. Harding
On Tue, Mar 21, 2017 at 03:53:46PM +0300, Dan Carpenter wrote: > On Tue, Mar 21, 2017 at 01:37:12PM +1100, Tobin C. Harding wrote: > > static int ks7010_sdio_data_compare(struct ks_wlan_private *priv, u32 > > address, > > unsigned char *da

Re: [PATCH] Staging: ks7010 - fixed style block comments

2017-03-21 Thread Tobin C. Harding
On Wed, Mar 22, 2017 at 07:29:50AM +1300, Derek Robson wrote: > On Tue, Mar 21, 2017 at 08:56:25AM +0100, Greg KH wrote: > > On Sun, Mar 19, 2017 at 01:07:17PM +1300, Derek Robson wrote: > > > Fixed style of all block comments across whole driver > > > Found by checkpatch > > > > > > Signed-off-by

[PATCH 1/4] staging: ks7010: fix memcmp() bug

2017-03-21 Thread Tobin C. Harding
: Tobin C. Harding --- drivers/staging/ks7010/ks7010_sdio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c index 28b91be..dbb1f05 100644 --- a/drivers/staging/ks7010/ks7010_sdio.c +++ b/drivers

[PATCH 3/4] staging: ks7010: add explicit check to 'size' variables

2017-03-21 Thread Tobin C. Harding
When checking the value of a variable that holds a 0 an explicit check is good style. i.e -if (!size) +if (size == 0) Update checks on 'numerical' variables to use explicit checks. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks7010_sdio.c | 4 ++-- drive

[PATCH 0/4] staging: ks7010: fix style issues

2017-03-21 Thread Tobin C. Harding
Patch 03 adds previously removed explicit checks to 'size' variables. Patch 04 adds previously removed braces to multi-line single statement code blocks. Code has not been tested. Patch set applies and builds on x86_64 and PowerPC. Tobin C. Harding (4): staging: ks7010: fix memcmp() b

[PATCH 2/4] staging: ks7010: add explicit check to memcmp() calls

2017-03-21 Thread Tobin C. Harding
Calls to functions memcmp() and strcmp() are more clearly readable when the return value is explicitly checked. i.e if (memcmp(foo, bar, size) == 0) Modify driver to use an explicit check on the value returned by memcmp(). Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks_hostif.c

[PATCH 4/4] staging: ks7010: add braces to multi-line indent

2017-03-21 Thread Tobin C. Harding
The addition of curly braces around single statements that span multiple lines makes the code more readable in general. Add curly braces to multi-line indented statement. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks_hostif.c | 18 ++ 1 file changed, 10

[PATCH 2/2] staging: ks7010: invert if statement conditionals

2017-03-21 Thread Tobin C. Harding
conditionals, return from function if new conditional evaluates to true. Reduce the level of indentation in subsequent code. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks_hostif.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers

[PATCH 0/2] staging: ks7010: refactor hostif_sme_task()

2017-03-21 Thread Tobin C. Harding
Function lends itself to being refactored. There are two checkpatch issues generated from this function. Patch 01 removes a redundant nested conditional check. Patch 02 inverts two conditionals, and reduces the subsequent code indentation. Tobin C. Harding (2): staging: ks7010: remove

[PATCH 1/2] staging: ks7010: remove redundant check

2017-03-21 Thread Tobin C. Harding
Function checks for condition inside a loop that checks the same condition, this is redundant. Fix also removes checkpatch CHECK. Remove redundant check. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks_hostif.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a

[PATCH 2/3] staging: ks7010: rename identifier rc to ret

2017-03-26 Thread Tobin C. Harding
;ret' needs refactoring, checkpatch emits WARNING: Avoid multiple line dereference. Rename rc -> ret. Move dereference to single line and correctly align function arguments. Remove definition of 'ret' at declaration time. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010

[PATCH 0/3] staging: ks7010: refactor tx_device_task()

2017-03-26 Thread Tobin C. Harding
ion argument alignment, and checkpatch CHECK. Code is untested. Patch set applies and builds on x86_64 and PowerPC. Tobin C. Harding (3): staging: ks7010: invert conditional, reduce indentation staging: ks7010: rename identifier rc to ret staging: ks7010: fix checkpatch PARENTHESIS_ALIGNM

[PATCH 3/3] staging: ks7010: fix checkpatch PARENTHESIS_ALIGNMENT

2017-03-26 Thread Tobin C. Harding
Checkpatch emits CHECK: Alignment should match open parenthesis. Align function arguments correctly. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks7010_sdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers

[PATCH 1/3] staging: ks7010: invert conditional, reduce indentation

2017-03-26 Thread Tobin C. Harding
27;!=' to '=='. Return if new conditional evaluates to true. Reduce indentation in subsequent code. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks7010_sdio.c | 43 ++-- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/dr

[PATCH 5/5] staging: ks7010: fix checkpatch UNNECESSARY_ELSE

2017-03-26 Thread Tobin C. Harding
Checkpatch emits WARNING: else is not generally useful after a break or return. Two warnings of this type are emitted, both are correct, 'else' statements are unnecessary. Remove unnecessary 'else' statements, reduce indentation in subsequent code. Signed-off-by: Tobin C. H

[PATCH 1/5] staging: ks7010: remove unused execution path

2017-03-26 Thread Tobin C. Harding
o branches of multi-way statement that can never be executed. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks_wlan_net.c | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_n

[PATCH 3/5] staging: ks7010: fix parameter placement

2017-03-26 Thread Tobin C. Harding
unnecessary newline in preceding code. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks_wlan_net.c | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c index b467307

[PATCH 0/5] staging: ks7010: refactor, fix checkpatch

2017-03-26 Thread Tobin C. Harding
the pointer is dereferenced. Patch 03 removes multi-line dereference. Patch 04 fixes parenthesis alignment Patch 05 removes unnecessary 'else' statements. Code is untested. Patch set builds on x86_64 and PowerPC. Tobin C. Harding (5): staging: ks7010: remove unused execution path

[PATCH 2/5] staging: ks7010: move null check before dereference

2017-03-26 Thread Tobin C. Harding
Pointer is dereferenced before the null check. Pointer variable is set (using a cast) to point to a function argument, the pointer is then dereferenced before it is checked for non-null. Move null check to before the dereference. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010

[PATCH 4/5] staging: ks7010: fix checkpatch PARENTHESIS_ALIGNMENT

2017-03-26 Thread Tobin C. Harding
Checkpatch emits CHECK: Alignment should match open parenthesis. Align argument to open parenthesis. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks_wlan_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers

[PATCH 01/12] staging: ks7010: simplify complex logical statment

2017-03-26 Thread Tobin C. Harding
returning if it evaluates to false. Declare variable 'do_mic', assign truth value to 'do_mic' as it appears in original conditional statement. AND in the key length, as in original. If variable 'do_mic' is false, return from function. Do not change program logic. Signed-o

[PATCH 04/12] staging: ks7010: rename identifier packet to skb

2017-03-26 Thread Tobin C. Harding
Of the 8088 instances of 'struct sk_buff *' within net/ 6670 are named 'skb'. This is a strong indication that the identifier 'sbk' is better suited when naming sk_buff pointer variables than 'packet'. Rename identifier 'packet' to 'skb&#

[PATCH 05/12] staging: ks7010: fix checkpatch LOGICAL_CONTINUATIONS

2017-03-26 Thread Tobin C. Harding
into a variable assignment. Move logical continuations to the end of the previous line. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks_hostif.c | 28 +++- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/staging/ks7010/ks_hostif.c b

[PATCH 08/12] staging: ks7010: replace magic number 8

2017-03-26 Thread Tobin C. Harding
constant. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks_hostif.c | 12 ++-- drivers/staging/ks7010/michael_mic.h | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c index 6fc8360

[PATCH 02/12] staging: ks7010: rename RecvMIC to recv_mic

2017-03-26 Thread Tobin C. Harding
Identifier uses camel case, standard kernel style does not use camel case. Rename buffer RecvMIC to recv_mic. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks_hostif.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/ks7010/ks_hostif.c b

[PATCH 00/12] staging: ks7010: refactor hostif_data_request()

2017-03-26 Thread Tobin C. Harding
ns as function argument. Code is build tested only (x86_64 and PowerPC). Tobin C. Harding (12): staging: ks7010: simplify complex logical statment staging: ks7010: rename RecvMIC to recv_mic staging: ks7010: add item to TODO file staging: ks7010: rename identifier packet to skb st

[PATCH 06/12] staging: ks7010: fix checkpatch MULTILINE_DEREFERENCE

2017-03-26 Thread Tobin C. Harding
Checkpatch emits WARNING: Avoid multiple line dereference. Fix up layout of function call, move dereference to single line. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks_hostif.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/staging/ks7010

[PATCH 10/12] staging: ks7010: replace magic number 12

2017-03-26 Thread Tobin C. Harding
/if_ether.h define ETH_ALEN 6 /* Octets in one ethernet addr */ Replace magic number 12 with ETH_ALEN * 2. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks_hostif.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/ks7010/ks_hostif.c

[PATCH 07/12] staging: ks7010: move null check before dereference

2017-03-26 Thread Tobin C. Harding
ereference. Move null check code to be before dereference. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks_hostif.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c index 2917dd

[PATCH 03/12] staging: ks7010: add item to TODO file

2017-03-26 Thread Tobin C. Harding
provides custom wrappers that may also need to be implemented in ks7010 and also orinoco uses crypto_shash_*() kernel cryptography functions. Some knowledge of cryptography and wireless networking is required. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/TODO | 2 ++ 1 file changed

[PATCH 11/12] staging: ks7010: clean up comments

2017-03-26 Thread Tobin C. Harding
Some function comments are unnecessary. There is some commented out code, it should be removed. Some comments say what the code is doing (instead of why), these comments are unnecessary. Clean up comments. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks_hostif.c | 14

[PATCH 09/12] staging: ks7010: replace magic number 6

2017-03-26 Thread Tobin C. Harding
*/ Replace magic number 6 with ETH_ALEN. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks_hostif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c index 0455cda..18c006d 100644 --- a/drivers/staging

[PATCH 12/12] staging: ks7010: add intermediate variable

2017-03-26 Thread Tobin C. Harding
complex function call with simplified call using newly defined variable. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks_hostif.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c index

[PATCH 1/3] staging: ks7010: rename identifier retval to ret

2017-03-26 Thread Tobin C. Harding
Driver predominately uses the identifier 'ret' for the error return code. Function uses 'retval' for this task. It is cleaner if we use a single name for a single task. Rename 'retval' to 'ret'. Signed-off-by: Tobin C. Harding --- d

[PATCH 3/3] staging: ks7010: fix whitespace issues

2017-03-26 Thread Tobin C. Harding
even though doing so introduces two new checkpatch line over 80 warnings, resulting code is cleaner. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks7010_sdio.c | 20 +++- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/drivers/staging/ks7010

[PATCH 0/3] staging: ks7010: refactor ks_sdio_interrupt()

2017-03-26 Thread Tobin C. Harding
el of indentation in subsequent code by one level. Patch 03 fixes white space issues, clearing a couple of checkpatch warnings and trivial style issues. Code is build-tested only (x86_64 and PowerPC). Tobin C. Harding (3): staging: ks7010: rename identifier retval to ret staging: ks7010: invert

[PATCH 2/3] staging: ks7010: invert conditional, reduce indentation

2017-03-26 Thread Tobin C. Harding
Bulk of function is guarded by an if statement. If we invert the conditional and return, the subsequent code can be indented one level less. Invert if statement conditional. '>=' to '<'. Jump to goto label if new conditional evaluates to true. Do not change program logi

[PATCH 0/6] staging: dgnc: fix/remove comments

2017-03-27 Thread Tobin C. Harding
function comments on functions with external linkage. Patch 04 removes struct magic number members and validity checks. Patch 05 removes dead code, guarded by preprocessor '#if 1' Patch 06 cleans the TODO file Code is untested. Builds on x86_64 and PowerPC. Tobin C. Harding (6): sta

[PATCH 1/6] staging: dgnc: clean up header comments

2017-03-27 Thread Tobin C. Harding
TODO file has task: remove unnecessary comments. Driver uses some custom comment format. Driver would be better if it used kernel doc format. Audit header file comments. Replace struct comments with kernel doc format comments. Remove unnecessary comments. Signed-off-by: Tobin C. Harding

[PATCH 3/6] staging: dgnc: remove unnecessary comments

2017-03-27 Thread Tobin C. Harding
. For functions with external linkage, migrate the function comment to kernel doc format. Signed-off-by: Tobin C. Harding --- drivers/staging/dgnc/dgnc_cls.c| 104 +++-- drivers/staging/dgnc/dgnc_driver.c | 85 ++ drivers/staging/dgnc/dgnc_mgmt.c | 29 ++--- drivers

[PATCH 6/6] staging: dgnc: remove error message task

2017-03-27 Thread Tobin C. Harding
TODO file lists task to remove unnecessary error messages. There are no unnecessary error messages in the driver, this must have been done already. Remove task from TODO file. Signed-off-by: Tobin C. Harding --- drivers/staging/dgnc/TODO | 2 -- 1 file changed, 2 deletions(-) diff --git a

[PATCH 4/6] staging: dgnc: remove struct member magic numbers

2017-03-27 Thread Tobin C. Harding
Driver uses magic number members within structs, this is an antiquated method of catching data errors. We don't do things that way any more. Remove magic number struct members. Remove all checks to magic numbers. Signed-off-by: Tobin C. Harding --- drivers/staging/dgnc/dgnc_cls.c

[PATCH 2/6] staging: dgnc: remove double underscore

2017-03-27 Thread Tobin C. Harding
Pre-processor header guards use double underscore, typically kernel code uses single underscore when defining header guards. 'endif' statement should include what is ending as a comment string. Remove double underscore, add comment string to 'endif' Signed-off-by: Tobin C. H

[PATCH 5/6] staging: dgnc: remove dead code

2017-03-27 Thread Tobin C. Harding
Driver contains dead code, guarded with #ifdef's. We can safely remove this, it will be in the git history if it is later needed. Remove dead code. Signed-off-by: Tobin C. Harding --- drivers/staging/dgnc/dgnc_neo.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/st

[PATCH 0/3] staging: ks7010: clean function calls

2017-03-27 Thread Tobin C. Harding
fixes a buffer overflow, not a real bug since the containing function has internal linkage. Fixing this prevents future failure. Code is untested. Builds on x86_64 and PowerPC. Tobin C. Harding (3): staging: ks7010: remove unnecessary function parameter staging: ks7010: remove void * cast

[PATCH 2/3] staging: ks7010: remove void * cast

2017-03-27 Thread Tobin C. Harding
ks_wlan_private *. Remove unnecessary casting to and from void *. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks7010_sdio.c | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c

[PATCH 3/3] staging: ks7010: fix buffer overflow vulnerability

2017-03-27 Thread Tobin C. Harding
7;size' as the parameter to kmalloc() instead of a constant. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks7010_sdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c index 3403edd..341

[PATCH 1/3] staging: ks7010: remove unnecessary function parameter

2017-03-27 Thread Tobin C. Harding
Function ks7010_upload_firmware() has two struct pointer parameters, one of which is a member of the other. This is unnecessary. Remove unnecessary function parameter. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks7010_sdio.c | 7 +++ 1 file changed, 3 insertions(+), 4

[PATCH 2/3] staging: ks7010: factor out send stop request

2017-03-27 Thread Tobin C. Harding
Function contains a block of code combined as a compound statement. This would be better factored out into a separate function. Factor compound statement out into a separate function. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks7010_sdio.c | 46

[PATCH 1/3] staging: ks7010: invert conditional, reduce indentation

2017-03-27 Thread Tobin C. Harding
be indented one level less while not changing the program logic. Add goto label. Invert if statement conditional, jump to label if new conditional evaluates to true. Reduce indentation of subsequent code by one level. Do not change the program logic. Signed-off-by: Tobin C. Harding --- drivers

[PATCH 0/4] staging: ks7010: refactor ks7010_sdio_remove()

2017-03-27 Thread Tobin C. Harding
. Patch 03 removes extraneous newlines. Code is untested. Builds on x86_64 and PowerPC. Tobin C. Harding (3): staging: ks7010: invert conditional, reduce indentation staging: ks7010: factor out send stop request staging: ks7010: remove extraneous newlines. drivers/staging/ks7010/ks7010_sdio.c

[PATCH 3/3] staging: ks7010: remove extraneous newlines.

2017-03-27 Thread Tobin C. Harding
Function contains extraneous newlines. Removing these lines aids readability. Remove extraneous newlines. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks7010_sdio.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging

Re: [PATCH 1/1] staging: rtl8188eu: Macros with complex values should be enclosed in parentheses

2017-03-28 Thread Tobin C. Harding
On Tue, Mar 28, 2017 at 09:56:19PM +0100, Alfonso Lima Astor wrote: > Fix coding style issue > > Signed-off-by: Alfonso Lima Astor > --- Hi Alfonso, You don't need to put 1/1 in the subject of a single patch. You may like to limit your git log summary to 50 characters (and the main body to abou

Re: [PATCH 0/6] staging: ks7010: fix endian issues

2017-03-29 Thread Tobin C. Harding
On Thu, Mar 16, 2017 at 11:27:21PM +1100, Tobin C. Harding wrote: > Sparse emits numerous warnings highlighting endian issues. The > endianess is deterministic because the function calls that are causing > the issues either accept as parameters, or return as results, types of > speci

Re: [PATCH 0/3] staging: ks7010: refactor tx_device_task()

2017-03-29 Thread Tobin C. Harding
On Wed, Mar 29, 2017 at 09:21:20AM +0200, Greg Kroah-Hartman wrote: > On Sun, Mar 26, 2017 at 07:45:12PM +1100, Tobin C. Harding wrote: > > Function tx_device_task() is a candidate for refactoring. Checkpatch > > emits a number of warnings/checks for this function. > > &g

[PATCH 01/25] staging: ks7010: remove unnecessary function parameter

2017-03-30 Thread Tobin C. Harding
Function ks7010_upload_firmware() takes as parameters, two struct pointers, one of which is a member of the other. This is unnecessary since one can be accessed via the other. Remove function parameter and fix all call sites. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010

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

2017-03-30 Thread Tobin C. Harding
ducing 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

[PATCH 04/25] staging: ks7010: rename identifier rc to ret

2017-03-30 Thread Tobin C. Harding
Driver uses identifier 'rc' to hold the value for error return code. The rest of the driver predominately uses 'ret' for this purpose. It is easier to follow the code if one name is used for one task. Rename identifier 'rc' to 'ret'. Signed-off-by: Tobin

[PATCH 03/25] staging: ks7010: add BUG_ON() to catch programmer error

2017-03-30 Thread Tobin C. Harding
esigned for catching these cases. Currently there is only one call site and it is correct, adding BUG_ON() will potentially save developer time if later changes to the code are incorrect. Use BUG_ON() to guard buffer write size in function with internal linkage. Signed-off-by: Tobin C. Harding

<    1   2   3   4   5   6   >