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
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
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
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
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.
> >
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.
> >
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
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
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
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
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
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
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
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
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?
>
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
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
>
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
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
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 ++-
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
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
++
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
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
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
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/
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
>
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
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
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
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
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
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
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
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
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
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 ++-
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
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
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
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
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
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
: 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
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 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
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
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
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
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
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
;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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
/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
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
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
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
*/
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
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
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
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
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
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
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
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
. 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
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
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
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
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
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
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
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
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
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
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 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
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
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
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
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
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
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
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
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
201 - 300 of 566 matches
Mail list logo