[PATCH] staging: rtl8723bs: clean up identical code on an if statement

2017-04-13 Thread Colin King
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.

[PATCH] staging: media: atomisp: fix range checking on clk_num

2017-04-14 Thread Colin King
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

[PATCH] staging: rtl8192u: fix spelling mistake in variable name *attentuation

2017-04-21 Thread Colin King
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.

[PATCH] staging: rtl8188eu, rtl8723bs: fix spelling mistake "Cancle" -> "Cancel"

2017-05-13 Thread Colin King
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

[PATCH][media] atomisp: make repool_pgnr and punit_ddr_dvfs_enable static

2017-06-02 Thread Colin King
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

[PATCH] staging: rtl8723bs: fix a couple of spelling mistakes

2017-06-03 Thread Colin King
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

[PATCH] staging: rtl8723bs: fix another spelling mistake

2017-06-03 Thread Colin King
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

[PATCH] taging: ccree: fix spelling mistake: "chanined" -> "chained"

2017-06-03 Thread Colin King
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

[PATCH][V2] staging: ccree: fix spelling mistake: "chanined" -> "chained"

2017-06-03 Thread Colin King
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

[PATCH][V2] staging: rtl8723bs: fix a couple of spelling mistakes

2017-06-05 Thread Colin King
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

[PATCH] atomisp: ensure that status values > 7 are reported as errors

2017-06-06 Thread Colin King
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

[PATCH] staging: wilc1000: fix a couple of memory leaks

2016-03-21 Thread Colin King
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

[PATCH] staging: sm750fb: initialize max_d to maximum D value of 6

2016-03-29 Thread Colin King
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

[PATCH] staging: speakup: ensure we do not overrun synths array

2016-05-09 Thread Colin King
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

[PATCH] Staging: iio: adc: fix indent on break statement

2016-01-23 Thread Colin King
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

[PATCH] staging: wilc1000: remove wilc1000_spi_ops as it is not used

2016-02-15 Thread Colin King
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; ^

[PATCH] staging: r8188eu: fix spelling mistake on xmitframe_coalsece

2016-12-29 Thread Colin King
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

[PATCH] staging: bcm2835-audio: use | instead of || otherwise result is just boolean 1

2017-02-01 Thread Colin King
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

[PATCH 2/2] staging: rts5208: remove unncessary result set and check, just return SUCCESS

2017-02-02 Thread Colin King
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

[PATCH 1/2] staging: rts5208: remove redundant retval status check

2017-02-02 Thread Colin King
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

[PATCH] staging: rtl8192u: remove redundant null check on array alg

2017-02-09 Thread Colin King
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 +++

[PATCH] Staging: rtl8192e: remove redundant null check on array alg

2017-02-09 Thread Colin King
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

[PATCH] staging: greybus: uart: fix uninitialized newline.flow_control

2017-02-09 Thread Colin King
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

[PATCH] staging: comedi: adl_pci9118: fix spelling mistake "acqusition" -> "acquisition"

2016-06-03 Thread Colin King
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

[PATCH] staging: wilc1000: fix spelling mistake: "interupts" -> "interrupts"

2016-06-23 Thread Colin King
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

[PATCH] staging: rtl8723au: hal: check BT_Active and BT_State with correct bit pattern

2016-07-14 Thread Colin King
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

[PATCH] staging: comedi: dt2811: add parentheses to fix logic on s->subdev_flags

2016-07-25 Thread Colin King
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

[PATCH] staging: ks7010: do not dereference priv if priv is null

2016-08-13 Thread Colin King
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

[PATCH] staging: ks7010: don't print skb->dev->name if skb is null

2016-08-15 Thread Colin King
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

[PATCH] staging: wilc1000: correctly check if associatedsta has not been found

2016-08-15 Thread Colin King
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

[PATCH] Staging: comedi: fix spelling mistake "Firmare" -> "Firmware"

2016-08-22 Thread Colin King
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

[PATCH] staging: wilc1000: fix spelling mistake: "retyring" -> "retrying"

2016-08-28 Thread Colin King
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

[PATCH] staging: ks7010: avoid dereferencing packet if it is null

2016-09-07 Thread Colin King
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

[PATCH] staging: ks7010: fix two memory leaks on error return path

2016-09-09 Thread Colin King
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(+

[PATCH] greybus: audio: ensure module is set to avoid crash on dev_err message

2016-09-23 Thread Colin King
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

[PATCH] staging: iio: cdc: ad7746: set ret on IIO_VOLTAGE case

2016-10-25 Thread Colin King
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

[PATCH] staging: lustre: lov: Fix signed wrap around when decrementing index 'i'

2016-11-10 Thread Colin King
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/

[PATCH] staging: unisys: ix spelling mistake of "outstanding"

2016-11-29 Thread Colin King
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

[PATCH] staging: wilc1000: fix spelling mistake: "dissconect" -> "disconnect"

2017-06-27 Thread Colin King
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

[PATCH] staging: rtl8192e: fix spelling mistake: "respose" -> "response"

2017-06-27 Thread Colin King
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/

[PATCH] staging: speakup: make function ser_to_dev static

2017-06-28 Thread Colin King
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

[PATCH] staging: ks7010: fix spelling mistake: "errror" -> "error"

2017-06-28 Thread Colin King
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

[PATCH] staging: wilc1000: fix a typo: "incative" -> "inactive"

2017-06-30 Thread Colin King
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

[PATCH][V2] staging: fbtft: make const array gamma_par_mask static

2017-07-11 Thread Colin King
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

[PATCH] [media] staging: media: davinci_vpfe: fix spelling mistake in variable

2017-07-13 Thread Colin King
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

[PATCH] staging: lustre: fix spelling mistake, "grranted" -> "granted"

2017-07-14 Thread Colin King
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

[PATCH][V2] staging: lustre: fix spelling mistake, "grranted" -> "granted"

2017-07-14 Thread Colin King
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

[PATCH] staging: pi433: Fix a couple of spelling mistakes

2017-07-17 Thread Colin King
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

[PATCH 1/3][staging-next] staging: pi433: Make a couple of functions static

2017-07-18 Thread Colin King
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

[PATCH 3/3][staging-next] staging: pi433: fix thread_run failure check

2017-07-18 Thread Colin King
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 +--

[PATCH 2/3][staging-next] staging: pi433: Make functions rf69_set_bandwidth_intern static

2017-07-18 Thread Colin King
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 -

[PATCH] staging: vboxvideo: make a couple of symbols static

2017-07-19 Thread Colin 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

[PATCH] staging: lustre: lnet: fix incorrect arguments order calling lstcon_session_new

2017-07-19 Thread Colin King
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

[PATCH] Make functions rf69_set_bandwidth_intern and rf69_set_dc_cut_off_frequency_intern static

2017-07-20 Thread Colin King
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

[PATCH] staging: rtl8192u: fix incorrect mask and shift on u8 data

2017-07-21 Thread Colin King
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

[PATCH] staging: rtl8192u: fix spelling mistake: "Senondary" -> "Secondary"

2017-07-24 Thread Colin King
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

[PATCH] staging: wilc1000: fix spelling mistake: "Iinitialization" -> "initialization"

2017-07-27 Thread Colin King
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

[PATCH] staging: fsl-mc: fix fsl_mc_is_allocatable strcmps

2017-08-16 Thread Colin King
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:

[PATCH] Revert "staging: fsl-mc: be consistent when checking strcmp() return"

2017-08-16 Thread Colin King
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

[PATCH][V2] Revert "staging: fsl-mc: be consistent when checking strcmp() return"

2017-08-16 Thread Colin King
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

[PATCH] staging/rts5208: fix incorrect shift to extract upper nybble

2017-08-18 Thread Colin King
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

[PATCH][next] staging: r8822be: fix a couple of spelling mistakes

2017-08-22 Thread Colin King
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

[PATCH][staging-next] staging: typec: tcpm: make function tcpm_get_pwr_opmode

2017-08-22 Thread Colin King
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

[PATCH][next] staging: r8822be: fix memory leak of eeprom_map on error exit return

2017-08-23 Thread Colin King
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

[PATCH] staging: r8822be: fix null pointer dereference with a null driver_adapter

2017-08-23 Thread Colin King
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.

[PATCH][staging-next] staging: pi433: fix spelling mistake: "preample" -> "preamble"

2017-08-30 Thread Colin King
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

[PATCH] staging: rts5208: rename mmc_ddr_tunning_rx_cmd to mmc_ddr_tuning_rx_cmd

2017-08-31 Thread Colin King
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

[PATCH][staging-next] staging: unisys: visorbus: make two functions static

2017-09-01 Thread Colin King
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

[PATCH][staging-next] staging: typec: fusb302: make structure fusb302_psy_desc static

2017-09-01 Thread Colin King
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

[PATCH] staging: rtl8192u: fix incorrect mask when calculating TxPowerLevelCCK

2017-09-05 Thread Colin King
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

[PATCH] fix null pointer dereferences with a null driver_adapter

2017-09-08 Thread Colin King
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

[PATCH][V2] staging: r8822be: fix null pointer dereferences with a null driver_adapter

2017-09-08 Thread Colin King
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

[PATCH] staging: wilc1000: fix memory leak on mgmt_tx on error return path

2015-10-09 Thread Colin King
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

[PATCH][staging-next] ncpfs: remove redundant cast of struct ncp_inode_info

2018-01-09 Thread Colin King
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

[PATCH][next] staging: ccree: fix memory leaks in cc_ivgen_init

2018-01-12 Thread Colin King
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

[PATCH][next] staging: fsl-mc: make function its_fsl_mc_msi_init static

2018-01-17 Thread Colin King
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

[PATCH] staging: rtl8192e: remove two redundant assignments

2018-01-20 Thread Colin King
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'

[PATCH] staging: rtl8712: remove redundant initialization to 'rfPath'

2018-01-20 Thread Colin King
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

[PATCH] staging: rtl8192u: remove redundant initialization of 'timeout'

2018-01-22 Thread Colin King
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

[PATCH] staging: comedi: dt2811: remove redundant initialization of 'ns'

2018-01-23 Thread Colin King
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

[PATCH] staging: rtl8188eu: remove redundant initialization of 'pwrcfgcmd'

2018-01-23 Thread Colin King
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

[PATCH] staging: rtl8723bs: remove a couple of redundant initializations

2018-01-26 Thread Colin King
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

[PATCH] staging: rtlwifi: remove redundant initialization of 'cfg_cmd'

2018-01-26 Thread Colin King
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

[PATCH] media: staging: atomisp: remove redundant assignments to various variables

2018-01-26 Thread Colin King
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:

[PATCH] staging: rtl8723bs: fix u8 less than zero check

2018-02-23 Thread Colin King
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

[PATCH] staging: rtl8192u: return -ENOMEM on failed allocation of priv->oldaddr

2018-02-28 Thread Colin King
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.

[PATCH] staging: comedi: adl_pci6208: remove redundant initialization of 'val'

2018-03-12 Thread Colin King
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

[PATCH] staging: media: davinci_vpfe: fix spelling of resizer_configure_in_continious_mode

2018-03-19 Thread Colin King
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(-)

[PATCH] staging: wilc1000: check for kmalloc allocation failures

2018-03-21 Thread Colin King
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

[PATCH] staging: mt7621-eth: fix spelling mistake: "devictree" -> "devicetree"

2018-03-22 Thread Colin 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

[PATCH][next] staging: r8822be: fix type in guard macro __PHYDMKFREE_H__

2018-03-23 Thread Colin King
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

[PATCH][next][V2] staging: r8822be: fix typos in header guard macros

2018-03-23 Thread Colin King
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]

[PATCH][V3] staging: r8822be: fix typos in header guard macros

2018-03-25 Thread Colin King
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]

[PATCH] staging: wilc1000: replace kmalloc + memcpy with kmemdup

2018-03-26 Thread Colin King
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 +++--

[PATCH] staging: fbtft: fb_st7789v: make HSD20_IPS numeric and not a string

2020-05-21 Thread Colin King
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

[PATCH][next] media: atomisp: fix a handful of spelling mistakes

2020-05-21 Thread Colin King
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

[PATCH] media: atomisp: make const arrays static, makes object smaller

2020-06-11 Thread Colin King
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

[PATCH][next] staging: wfx: fix uninitialized variable bytes_done

2020-07-06 Thread Colin King
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

[PATCH] media: atomisp: fix mask and shift operation on ISPSSPM0

2020-07-16 Thread Colin King
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.

[PATCH] staging: rtl8192u: fix a dubious looking mask before a shift

2020-07-16 Thread Colin King
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

<    1   2   3   4   >