From: Colin Ian King
The two different paths for an if statement are identical and hence
we can just replace it with the single statement.
Detected by CoverityScan, CID#1428443 ("Identical code for
different branches")
Signed-off-by: Colin Ian King
---
drivers/staging/rtl8723bs/core/rtw_mlme.
From: Colin Ian King
The range checking on clk_num is incorrect; fix these so that invalid
clk_num values are detected correctly.
Detected by static analysis with by PVS-Studio
Signed-off-by: Colin Ian King
---
drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c | 8
1 fil
From: Colin Ian King
Fix the spelling of a bunch of variables, from *attentuation to
*attenuation. No functional change.
Signed-off-by: Colin Ian King
---
drivers/staging/rtl8192u/r8192U.h | 8 ++---
drivers/staging/rtl8192u/r8192U_core.c | 10 +++---
drivers/staging/rtl8192u/r8192U_dm.
From: Colin Ian King
Trivial fix to spelling mistakes in a comments and RT_TRACE text.
Signed-off-by: Colin Ian King
---
drivers/staging/rtl8188eu/core/rtw_mlme.c | 4 ++--
drivers/staging/rtl8723bs/core/rtw_mlme.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/driver
From: Colin Ian King
integer repool_pgnr and function punit_ddr_dvfs_enable can be made
static as they do not need to be in global scope.
Cleans up sparse warnings:
"symbol 'repool_pgnr' was not declared. Should it be static?"
"symbol 'punit_ddr_dvfs_enable' was not declared. Should it be stat
From: Colin Ian King
Replace cant with cannot, argumetns with arguments and
add line break to overly long DBG_871X statement.
Signed-off-by: Colin Ian King
---
drivers/staging/rtl8723bs/hal/hal_com.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/rtl87
From: Colin Ian King
I found one more spelling mistake in a DBG_8192C debug message,
replace "avaliable" with "available", add some spacing between
text and a number and split overly long line
Signed-off-by: Colin Ian King
---
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c | 3 ++-
1 file c
From: Colin Ian King
Trivial fix to spelling mistake in SSI_LOG_ERR message
Signed-off-by: Colin Ian King
---
drivers/staging/ccree/ssi_buffer_mgr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/ccree/ssi_buffer_mgr.c
b/drivers/staging/ccree/ssi_buffer_mg
From: Colin Ian King
Trivial fix to spelling mistake in SSI_LOG_ERR message
Signed-off-by: Colin Ian King
---
drivers/staging/ccree/ssi_buffer_mgr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/ccree/ssi_buffer_mgr.c
b/drivers/staging/ccree/ssi_buffer_mg
From: Colin Ian King
Replace cant with cannot, argumetns with arguments and
add line break to overly long DBG_871X statement.
Signed-off-by: Colin Ian King
---
drivers/staging/rtl8723bs/hal/hal_com.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/rtl87
From: Colin Ian King
The current code checks if a status value is greater than 7 and
sets the status string as "ERROR" and then over writes the
string based on the bottom 3 bits of the value. Instead, fix this by
only checking on the bottom 3 bits of the value if the value is less
than 8.
Detect
From: Colin Ian King
The ENOMEM error return paths are not free'ing allocated memory
resulting in a memory leak of allocated structures. Perform the
required kfree to fix the memory leaks.
Issue discovered with static analysis using CoverityScan
Signed-off-by: Colin Ian King
---
drivers/stagi
From: Colin Ian King
max_d is not initialized and should be set to the largest D
value of 6.
Signed-off-by: Colin Ian King
---
drivers/staging/sm750fb/ddk750_chip.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/sm750fb/ddk750_chip.c
b/drivers/staging/sm75
From: Colin Ian King
synth_add allows one to add MAXSYNTHS synths to the synths array;
however it always NULLifies the next synth in the array which
means that on the MAXSYNTHS synth we get an out-of-bounds write of
the NULL to the synths array. Make the synths array MAXSYNTHS + 1
elements in si
From: Colin Ian King
Fix indent warning when building with gcc 6:
drivers/staging/iio/adc/ad7192.c:239:4: warning: statement is indented
as if it were guarded by... [-Wmisleading-indentation]
Signed-off-by: Colin Ian King
---
drivers/staging/iio/adc/ad7192.c | 2 +-
1 file changed, 1 inserti
From: Colin Ian King
building with gcc 6 I hit a build failure:
CC drivers/staging/wilc1000/wilc_spi.o
drivers/staging/wilc1000/wilc_spi.c:123:34: error: storage size of
‘wilc1000_spi_ops’ isn’t known
static const struct wilc1000_ops wilc1000_spi_ops;
^
From: Colin Ian King
trivial fix to spelling mistake of function name in debuf message,
should be xmitframe_coalesce instead of xmitframe_coalsece.
Signed-off-by: Colin Ian King
---
drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
From: Colin Ian King
The incorrect or operator is being used resulting in cookies being
set to 1 (true) rather than the intended hex value. Fix this by
using | instead of ||.
Issue found with static analysis with cppcheck
Fixes: 0cec463e391e05b807a ("staging: bcm2835-audio: Simplify callback
From: Colin Ian King
Minor clean up, there is no need to assign result to zero, then
check if it is less than zero. Just return SUCCESS.
Signed-off-by: Colin Ian King
---
drivers/staging/rts5208/rtsx.c | 6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/rt
From: Colin Ian King
The retval status checks in the proceeding do loop return out
of function ms_read_attritbute_info if there is an error
condition, thus we never reach the end of the loop with
retval failed status. Therefore, the retval status check
at end of the do loop is redundant and can
From: Colin Ian King
u.crypt.alg is an array of u8 integers and hence the null check on
this array is redundant and can be removed.
Detected with CoverityScan, CID#143214 ("Array compared against 0")
Signed-off-by: Colin Ian King
---
.../staging/rtl8192u/ieee80211/ieee80211_softmac.c | 32 +++
From: Colin Ian King
u.crypt.alg is an array of u8 integers and hence the null check on
this array is redundant and can be removed.
Detected with CoverityScan, CID#146583 ("Array compared against 0")
Signed-off-by: Colin Ian King
---
drivers/staging/rtl8192e/rtllib_softmac.c | 32
From: Colin Ian King
Currently newline.flow_control is uninitialized, so it can contain
any garbage from the stack. I believe it should be initialized with
GB_SERIAL_AUTO_RTSCTS_EN enabled if the termios c_cflag is CRTSCTS
enabled.
Signed-off-by: Colin Ian King
---
drivers/staging/greybus/uar
From: Colin Ian King
trivial fix to spelling mistake
Signed-off-by: Colin Ian King
---
drivers/staging/comedi/drivers/adl_pci9118.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c
b/drivers/staging/comedi/drivers/adl_pci
From: Colin Ian King
trivial fix to spelling mistake in dev_err messages
Signed-off-by: Colin Ian King
---
drivers/staging/wilc1000/wilc_sdio.c | 2 +-
drivers/staging/wilc1000/wilc_spi.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_sdio
From: Colin Ian King
BT_Active and BT_State are being masked with 0x00ff so it the subsequent
comparisons with 0x are therefore a buggy check. Instead, check them
against 0x00ff.
Unfortunately I couldn't find a datasheet or hardware to see if 0x
is an expected invalid bi
From: Colin Ian King
We need to add parentheses around ternary operations because currently
the expression SDF_READABLE | (it->options[2] == 1) always evaluates to
true, meaning s->subdev_flags is always assigned SDF_DIFF. Putting the
parentheses around the ternarary operations results in the int
From: Colin Ian King
priv is being dereferenced before a check for it being null
is made, so there is a possibililty a null pointer deference
can occur. Instead, only dereference priv if it is non-null.
Signed-off-by: Colin Ian King
---
drivers/staging/ks7010/ks7010_sdio.c | 4 ++--
1 file cha
From: Colin Ian King
A null pointer dereference will occur when skb is null and
skb->dev->name is printed. Replace the skb->dev->name with
plain text "ks_wlan" to fix this.
Signed-off-by: Colin Ian King
---
drivers/staging/ks7010/ks_hostif.c | 6 ++
1 file changed, 2 insertions(+), 4 dele
From: Colin Ian King
The current check for associatedsta being set to -1 to indicate it has
not been found is not working because associatedsta is initialized to
zero and will never be -1. Fix this by initializing it to ~0 and checking
for ~0 instead.
Signed-off-by: Colin Ian King
---
drivers
From: Colin Ian King
Trivial fix to spelling mistake in dev_dbg message.
Signed-off-by: Colin Ian King
---
drivers/staging/comedi/drivers/jr3_pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/comedi/drivers/jr3_pci.c
b/drivers/staging/comedi/drivers/jr3
From: Colin Ian King
trivial fix to spelling mistake in dev_err message
Signed-off-by: Colin Ian King
---
drivers/staging/wilc1000/wilc_spi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/wilc1000/wilc_spi.c
b/drivers/staging/wilc1000/wilc_spi.c
index 22c
From: Colin Ian King
Updating tx_bytes from packet->len if packet is null will cause
a null pointer dereference, so only update tx_bytes if it packet
is not null.
Signed-off-by: Colin Ian King
---
drivers/staging/ks7010/ks_wlan_net.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff
From: Colin Ian King
On the error case where there is an invalid MAC address there is
memory leak on packet and pp on the error return. Free these first
before returning to fix the leak.
Signed-off-by: Colin Ian King
---
drivers/staging/ks7010/ks_hostif.c | 2 ++
1 file changed, 2 insertions(+
From: Colin Ian King
Currently, if info is null, the dev_err message is dereferencing an
uninitialized module pointer. Instead, initialize module before the
dev_err call to fix this issue.
Found using static analysis with cppcheck:
[drivers/staging/greybus/audio_topology.c:175]: (error)
Unini
From: Colin Ian King
For a IIO_VOLTAGE case, ret is not being set causing an
uninitialized value being returned by ad7746_read_raw. Fix
this by setting ret to IIO_VAL_INT for this specific case.
Signed-off-by: Colin Ian King
---
drivers/staging/iio/cdc/ad7746.c | 1 +
1 file changed, 1 inserti
From: Colin Ian King
Change predecrement compare to post decrement compare to avoid an
unsigned integer wrap-around comparisomn when decrementing in the while
loop.
Issue found with static analysis with CoverityScan, CID 1375917
Signed-off-by: Colin Ian King
---
drivers/staging/lustre/lustre/
From: Colin Ian King
Trivial fix to spelling mistake "oustanding" to "outstanding".
Signed-off-by: Colin Ian King
---
drivers/staging/unisys/visornic/visornic_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/unisys/visornic/visornic_main.c
b/drivers/s
From: Colin Ian King
Trivial fix to spelling mistake in netdev_err error message
Signed-off-by: Colin Ian King
---
drivers/staging/wilc1000/host_interface.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/wilc1000/host_interface.c
b/drivers/staging/wilc1000
From: Colin Ian King
Trivial fix to spelling mistake in netdev_info message and split
line to clean up an checkpatch line too wide warning.
Signed-off-by: Colin Ian King
---
drivers/staging/rtl8192e/rtllib_softmac.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/
From: Colin Ian King
The helper function ser_to_dev does not need to be in global scope, so
make it static.
Cleans up sparse warning:
"warning: symbol 'ser_to_dev' was not declared. Should it be static?"
Signed-off-by: Colin Ian King
---
drivers/staging/speakup/spk_ttyio.c | 2 +-
1 file chan
From: Colin Ian King
Trivial fix to spelling mistake in netdev_err message
Signed-off-by: Colin Ian King
---
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/staging/ks7010/ks_wlan_net.c
ind
From: Colin Ian King
Trivial fix to typos in netdev_err error messages. I should have spotted
this in a previous round of spelling mistake checks on this driver but
this one slipped through.
Signed-off-by: Colin Ian King
---
drivers/staging/wilc1000/host_interface.c | 4 ++--
1 file changed, 2
From: Colin Ian King
Don't populate array gamma_par_mask on the stack but instead make it
static. Makes the object code smaller by 148 bytes:
Before:
textdata bss dec hex filename
29931104 040971001 drivers/staging/fbtft/fb_st7789v.o
After:
textda
From: Colin Ian King
Trivial fix to spelling mistake, rename the function name
resizer_configure_in_continious_mode to
resizer_configure_in_continuous_mode and also remove an extraneous space.
Signed-off-by: Colin Ian King
---
drivers/staging/media/davinci_vpfe/dm365_resizer.c | 4 ++--
1 file
From: Colin Ian King
Trivial fix to spelling mistake in CERROR error message
Signed-off-by: Colin Ian King
---
drivers/staging/lustre/lustre/ptlrpc/import.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/lustre/lustre/ptlrpc/import.c
b/drivers/staging/lust
From: Colin Ian King
Trivial fix to spelling mistake in CERROR error message. Also
clean up the grammar.
Signed-off-by: Colin Ian King
---
drivers/staging/lustre/lustre/ptlrpc/import.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/lustre/lustre/ptlrpc/impo
From: Colin Ian King
Trivial fix to spelling mistakes in dev_dbg debug messages
"wiat" -> "wait"
"fonud" -> "found"
Signed-off-by: Colin Ian King
---
drivers/staging/pi433/pi433_if.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/pi433/pi433_if.c b/dri
From: Colin Ian King
The functions pi433_receive and pi433_tx_thread are local to the source
and do not need to be in global scope, so make them static
Cleans up sparse warnings:
symbol 'pi433_receive' was not declared. Should it be static?
symbol 'pi433_tx_thread' was not declared. Should it be
From: Colin Ian King
The check for thread_run failure is incorrect, use IS_ERR instead.
Cleans up sparse error message:
"error: incompatible types for operation (<)"
Fixes: 874bcba65f9a ("staging: pi433: New driver")
Signed-off-by: Colin Ian King
---
drivers/staging/pi433/pi433_if.c | 3 +--
From: Colin Ian King
The function rf69_set_bandwidth_intern is local to the source
and do not need to be in global scope, so make it static. Also
break overly wide line.
Cleans up sparse warning:
symbol 'update_share_count' was not declared. Should it be static?
Signed-off-by: Colin Ian King
-
From: Colin Ian King
Module parameter vbox_modeset and structure vbox_bo_driver do not need to
be in global scope and hence can be made static.
Cleans up a couple of sparse warnings:
symbol 'vbox_modeset' was not declared. Should it be static?
symbol 'vbox_bo_driver' was not declared. Should it
From: Colin Ian King
The arguments args->lstio_ses_force and args->lstio_ses_timeout are
in the incorrect order. Fix this by swapping them around.
Detected by CoverityScan, CID#1226833 ("Arguments in wrong order")
Signed-off-by: Colin Ian King
---
drivers/staging/lustre/lnet/selftest/conctl.c
From: Colin Ian King
The functions rf69_set_bandwidth_intern and also
rf69_set_dc_cut_off_frequency_intern is local to the source and
do not need to be in global scope, so make it static. Also break
break overly wide line. Finally, remove the function declaration
rf69_set_dc_cut_off_frequency_int
From: Colin Ian King
The cfg_action bit comes from the high bit of pmsg[4] so the
current mask and shift are in correct and always result in
zero. Fix this by using the correct mask and shif to get the
correct cfg_action bit value.
Detected by CoverityScan, CID#142890 ("Operands don't affect re
From: Colin Ian King
Trivial fix to spelling mistake in IEEE80211_DEBUG message
Signed-off-by: Colin Ian King
---
drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
b/drive
From: Colin Ian King
Trivial fix to spelling mistake in netdev_err message
Signed-off-by: Colin Ian King
---
drivers/staging/wilc1000/linux_wlan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/wilc1000/linux_wlan.c
b/drivers/staging/wilc1000/linux_wlan.c
From: Colin Ian King
The previous fix removed the equal to zero comparisons by the strcmps and
now the function always returns true. Fix this by adding in the missing
logical negation operators.
Detected by CoverityScan, CID#1452267 ("Constant expression result")
Fixes: b93ad9a067e1 ("staging:
From: Colin Ian King
The previous fix removed the equal to zero comparisons by the strcmps and
now the function always returns true. Revert this change to restore the
original correctly functioning code.
Detected by CoverityScan, CID#1452267 ("Constant expression result")
This reverts commit b9
From: Colin Ian King
The previous fix removed the equal to zero comparisons by the strcmps and
now the function always returns true. Revert this change to restore the
original correctly functioning code.
Detected by CoverityScan, CID#1452267 ("Constant expression result")
This reverts commit b9
From: Colin Ian King
The mask of sns_key_info1 suggests the upper nybble is being extracted
however the following shift of 8 bits is too large and always results in
0. Fix this by shifting only by 4 bits to correctly get the upper nybble.
Detected by CoverityScan, CID#142891 ("Operands don't af
From: Colin Ian King
Trivial fixes to spelling mistake in pr_err error messages:
errorr -> error
mismactch -> mismatch
Signed-off-by: Colin Ian King
---
.../staging/rtlwifi/halmac/halmac_88xx/halmac_api_88xx.c | 2 +-
.../rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c| 16
From: Colin Ian King
The function pointer tcpm_get_pwr_opmode is local to the source and does
not need to be in global scope, so make it static.
Cleans up sparse warning:
symbol 'tcpm_get_pwr_opmode' was not declared. Should it be static?
Signed-off-by: Colin Ian King
---
drivers/staging/type
From: Colin Ian King
A memory leak of eeprom_map occurs if the call to halmac_eeprom_parser_88xx
fails. Fix this by kfree'ing it before returning.
Detected by CoverityScan, CID#1454569 ("Resource leak")
Fixes: 938a0447f094 ("staging: r8822be: Add code for halmac sub-driver")
Signed-off-by: Coli
From: Colin Ian King
The call to _rtl_dbg_trace via macro HALMAC_RT_TRACE will trigger a null
pointer deference on the null driver_adapter. Fix this by assigning
driver_adapter earlier to halmac_adapter->driver_adapter before the tracing
call so that a non-null driver_adapter is passed instead.
From: Colin Ian King
Trivial fix to spelling mistake in dev_dbg message
Signed-off-by: Colin Ian King
---
drivers/staging/pi433/rf69.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
index f04840a799bb..c4b1b218ea3
From: Colin Ian King
Trival fix to spelling mistake in function name
Signed-off-by: Colin Ian King
---
drivers/staging/rts5208/sd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c
index b1fd0a10d065..4033a2cf7a
From: Colin Ian King
The functions sig_queue_offset and sig_data_offset are local to
the source and do not need to be in global scope, so make them
static.
Cleans up sparse warnings:
symbol 'sig_queue_offset' was not declared. Should it be static?
symbol 'sig_data_offset' was not declared. Shoul
From: Colin Ian King
The const structure fusb302_psy_desc is local to the source and
does not need to be in global scope, so make it static.
Cleans up sparse warnings
symbol 'fusb302_psy_desc' was not declared. Should it be static?
Signed-off-by: Colin Ian King
---
drivers/staging/typec/fusb3
From: Colin Ian King
The mask of 0xff and right shift of 8 bits on ret always results in
a value of 0 for TxPowerLevelCCK. I believe this should be a mask of
0xff00, however I do not have the hardware at hand to test this out,
so there is a distinct possibility I may be wrong on this.
Detected
From: Colin Ian King
The call to _rtl_dbg_trace via macro HALMAC_RT_TRACE will trigger a null
pointer deference on a null driver_adapter. Fix this by assigning
driver_adapter earlier to halmac_adapter->driver_adapter before the tracing
call so that a non-null driver_adapter is passed instead.
I
From: Colin Ian King
The call to _rtl_dbg_trace via macro HALMAC_RT_TRACE will trigger a null
pointer deference on a null driver_adapter. Fix this by assigning
driver_adapter earlier to halmac_adapter->driver_adapter before the tracing
call so that a non-null driver_adapter is passed instead.
I
From: Colin Ian King
Static analysis with cppcheck found the following memory leak:
[drivers/staging/wilc1000/linux_mon.c:255]: (error) Memory leak: mgmt_tx
Free mgmt_tx on the error return path when mgmt_tx->buff fails to be
allocated.
Signed-off-by: Colin Ian King
---
drivers/staging/wilc1
From: Colin Ian King
Casting a value returned by memory an allocation function is
not required and can be removed. Also add in a newline after before
the first statement. Code clean up as suggested by coccinelle.
Signed-off-by: Colin Ian King
---
drivers/staging/ncpfs/inode.c | 3 ++-
1 file c
From: Colin Ian King
The current error exit path in function cc_ivgen_init via label
'out' free's resources from the drvdata->ivgen_handle context.
However, drvdata->ivgen_handle has not been assigned to the
context ivgen_ctx at this point, so the resources are not freed.
Fix this by setting drvd
From: Colin Ian King
The function its_fsl_mc_msi_init is local to the source and does
not need to be in global scope, so make it static.
Cleans up sparse warning:
symbol 'its_fsl_mc_msi_init' was not declared. Should it be static?
Signed-off-by: Colin Ian King
---
drivers/staging/fsl-mc/bus/i
From: Colin Ian King
Clang detected two redundant assignments that can be safely removed.
The first is the removal of the duplicated assignment to pointer 'hdr',
this has already been initialized with the same value. The second is
the removal of the redundant initialization of variable 'timeout'
From: Colin Ian King
The value stored to rfPath during initialization is never read, the
following switch statement re-assigns it a new value on all the
case and default paths. Hence the initialization is redundant and
can be removed.
Cleans up clang warning:
drivers/staging/rtl8712/rtl871x_mp.c
From: Colin Ian King
Variable timeout is initialized however this value is never read and
it is reassigned a new value a little later, hence the initialization
is redundant and can be removed.
Cleans up clang warning:
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1728:6: warning:
Value
From: Colin Ian King
Variable ns is being initialized with a value that is never read, ns
is being re-assigned a new value later on. Remove the redundant
initialization.
Cleans up clang warning:
drivers/staging/comedi/drivers/dt2811.c:310:21: warning: Value stored
to 'ns' during its initializati
From: Colin Ian King
Structure pwrcfgcmd is being zero'd at initialization however this
value is never read as few statements later in a loop it is being
assigned a new value, hence the initialization is redundant and
can be removed.
Cleans up clang warning:
drivers/staging/rtl8188eu/hal/pwrseqc
From: Colin Ian King
The initialization of PwrCfgCmd is redundant as the value is never read
and it is being re-assigned to PwrSeqCmd[AryIdx] inside a loop, hence
it can be removed. Also, the initialization of ie_ptr is redundant as
the value is never read and it is being re-assigned in either p
From: Colin Ian King
The initialization of cfg_cmd is redundant as the value is never read
and it is being re-assigned to cfg_cmd = pwrcfgcmd[ary_idx] inside a
loop, hence it can be removed.
Cleans up clang warning:
drivers/staging/rtlwifi/core.c:1819:22: warning: Value stored to
'cfg_cmd' durin
From: Colin Ian King
There are various assignments that are being made to variables that are
not read and the variables are being updated later on, hence the redundant
assignments can be removed.
Cleans up clang warnings:
drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:1950:8:
warning:
From: Colin Ian King
The error variable ret is currently a u8 and so two comparisons
to see if an error return is less than zero will always be false
because ret is unsigned. Fix this by making ret an int.
Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
Signed-off-by: Colin Ian
From: Colin Ian King
Currently the allocation of priv->oldaddr is not null checked which will
lead to subsequent errors when accessing priv->oldaddr. Fix this with
a null pointer check and a return of -ENOMEM on allocation failure.
Detected with Coccinelle:
drivers/staging/rtl8192u/r8192U_core.
From: Colin Ian King
Variable 'val' is initialized with a value that is never read, it is
updated with a new value again after intitialization. Remove the
redundant initialization and move the declaration and assignment into
the scope of the for-loop.
Cleans up clang warning:
drivers/staging/com
From: Colin Ian King
Trivial fix: rename function resizer_configure_in_continious_mode to
resizer_configure_in_continuous_mode to fix spelling mistake.
Signed-off-by: Colin Ian King
---
drivers/staging/media/davinci_vpfe/dm365_resizer.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
From: Colin Ian King
There are three kmalloc allocations that are not null checked which
potentially could lead to null pointer dereference issues. Fix this
by adding null pointer return checks.
Detected by CoverityScan, CID#1466025-27 ("Dereference null return")
Signed-off-by: Colin Ian King
From: Colin Ian King
Trivial fix to spelling mistake in dev_err message text
Signed-off-by: Colin Ian King
---
drivers/staging/mt7621-eth/mtk_eth_soc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/mt7621-eth/mtk_eth_soc.c
b/drivers/staging/mt7621-eth/mtk
From: Colin Ian King
The #define for __PHYDMKFREE_H__ is missing a character and is not
the same as the guard check. Defined this correctly.
Cleans up clang warning:
warning: '__PHYDMKFREE_H__' is used as a header guard here, followed
by #define of a different macro [-Wheader-guard]
Fixes: 9ce
From: Colin Ian King
The macros for __PHYDMKFREE_H__ and __PHYDM_FEATURES_H__ contain
typos and don't match the #if guard check. Defined them correctly.
Cleans up clang warnings:
warning: '__PHYDMKFREE_H__' is used as a header guard here, followed
by #define of a different macro [-Wheader-guard]
From: Colin Ian King
The macros for __PHYDMKFREE_H__ and __PHYDM_FEATURES_H__ contain
typos and don't match the #if guard check. Defined them correctly.
Cleans up clang warnings:
warning: '__PHYDMKFREE_H__' is used as a header guard here, followed
by #define of a different macro [-Wheader-guard]
From: Colin Ian King
Replace several allocation and memcpys with kmemdup and add in some
missing memory allocation failure checks. Also fix an incorrect
-EFAULT return with -ENOMEM.
Signed-off-by: Colin Ian King
---
drivers/staging/wilc1000/host_interface.c | 75 +++--
From: Colin Ian King
Currently HSD20_IPS is defined as "true" and will always result in a
non-zero result even if it is defined as "false" because it is an array
and that will never be zero. Fix this by defining it as an integer 1
rather than a literal string.
Addessses-Coverity: ("Array compare
From: Colin Ian King
There are several spelling mistakes in various messages and literal
strings. Fix these.
Signed-off-by: Colin Ian King
---
.../staging/media/atomisp/pci/base/refcount/src/refcount.c | 2 +-
.../media/atomisp/pci/css_2401_system/host/csi_rx_private.h | 4 ++--
.../atomisp/p
From: Colin Ian King
Don't populate const arrays on the stack but instead make them
static. Makes the object code smaller by 150 bytes.
Before:
textdata bss dec hex filename
111083 23692 64 134839 20eb7 atomisp/pci/atomisp_compat_css20.o
After:
textdata
From: Colin Ian King
The variable bytes_done is not initialized and hence the first
FIFO size check on bytes_done may be breaking prematurely from
the loop if bytes_done contains a large bogus uninitialized value.
Fix this by initializing bytes_done to zero.
Addresses-Coverity: ("Uninitialized s
From: Colin Ian King
Currently the check on bits 25:24 on ISPSSPM0 is always 0 because
the mask and shift operations are incorrect. Fix this by shifting
by MRFLD_ISPSSPM0_ISPSSS_OFFSET (24 bits right) and then masking
with RFLD_ISPSSPM0_ISPSSC_MASK (0x03) to get the appropriate 2 bits
to check.
From: Colin Ian King
Currently the masking of ret with 0xff and followed by a right shift
of 8 bits always leaves a zero result. It appears the mask of 0xff
is incorrect and should be 0xff00, but I don't have the hardware to
test this. Fix this to mask the upper 8 bits before shifting.
[ Not te
201 - 300 of 311 matches
Mail list logo