[PATCH] ds3000: fix array out of bounds access

2014-03-14 Thread Colin King
From: Colin Ian King colin.k...@canonical.com cppcheck reports an array out of bounds access: [drivers/media/dvb-frontends/ds3000.c:619]: (error) Array 'dvbs2_snr_tab[80]' accessed at index 80, which is out of bounds. the index check is off by one, so fix this to avoid the error.

[PATCH] [media] hackrf: don't emit dev debug on a kfree'd or null dev

2015-11-11 Thread Colin King
From: Colin Ian King Static analysis with smatch detected a couple of issues: drivers/media/usb/hackrf/hackrf.c:1533 hackrf_probe() error: we previously assumed 'dev' could be null (see line 1366) drivers/media/usb/hackrf/hackrf.c:1533 hackrf_probe() error:

[PATCH] [media] c8sectpfe: fix ininitialized error return on firmware load failure

2015-09-15 Thread Colin King
From: Colin Ian King static analysis with cppcheck detected the following error: [drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c:1210]: (error) Uninitialized variable: ret ret is never initialised, so garbage is being returned. Instead return the error return

[PATCH] [media] netup_unidvb: trivial fix of spelling mistake "initizalize" -> "initialize"

2016-06-24 Thread Colin King
From: Colin Ian King trivial fix to spelling mistake in dev_err message Signed-off-by: Colin Ian King --- drivers/media/pci/netup_unidvb/netup_unidvb_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] [media] media: am437x-vpfe: ensure ret is initialized

2016-03-21 Thread Colin King
From: Colin Ian King ret should be initialized to 0; for example if pfe->fmt.fmt.pix.field is V4L2_FIELD_NONE then ret will contain garbage from the uninitialized state causing garbage to be returned if it is non-zero. Signed-off-by: Colin Ian King

[PATCH] [media] media: i2c: ths7303: remove redundant assignment on bt

2016-03-23 Thread Colin King
From: Colin Ian King The extraneous assignment on bt is redundant and can be removed. Signed-off-by: Colin Ian King --- drivers/media/i2c/ths7303.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] [media] m88rs2000: initialize status to zero

2016-05-09 Thread Colin King
From: Colin Ian King status is not initialized so it can contain garbage. The check for status containing the FE_HAS_LOCK bit may randomly pass or fail if the read of register 0x8c fails to set status after 25 read attempts. Fix this by initializing status to 0. Issue

[PATCH] helene: fix memory leak when heleno_x_pon fails

2016-08-14 Thread Colin King
From: Colin Ian King The error return path of failed calls to heleno_x_pon leak memory because priv is not kfree'd. Fix this by kfree'ing priv before returning. Signed-off-by: Colin Ian King --- drivers/media/dvb-frontends/helene.c | 8

[PATCH][media][V2] mb86a20s: apply mask to val after checking for read failure

2016-07-15 Thread Colin King
From: Colin Ian King Appling the mask 0x0f to the immediate return of the call to mb86a20s_readreg will always result in a positive value, meaning that the check of ret < 0 will never work. Instead, check for a -ve return value first, and then mask val with 0x0f.

[PATCH] [media] Staging: media/lirc: don't call put_ir_rx on rx twice

2017-02-17 Thread Colin King
From: Colin Ian King There is an exit path where rx is kfree'd on put_ir_rx and then a jump to label out_put_xx will again kfree it with another call to put_ir_rx. Fix this by adding a new label that avoids this 2nd call to put_ir_rx for this specific case. Detected

[PATCH] [media] saa7164: "first image" should be "second image" in error message

2017-01-18 Thread Colin King
From: Colin Ian King The error message when the second image is not available is incorrect, replace "first image" with "second image". Fixes CoverityScan CID#1077508 ("Copy-paste error") Signed-off-by: Colin Ian King ---

[PATCH] [media] pxa_camera: fix spelling mistake: "dequeud" -> "dequeued"

2016-08-18 Thread Colin King
From: Colin Ian King trivial fix to spelling mistake in pr_debug message Signed-off-by: Colin Ian King --- drivers/media/platform/soc_camera/pxa_camera.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] [media] cx24120: do not allow an invalid delivery system types

2016-09-03 Thread Colin King
From: Colin Ian King cx24120_set_frontend currently allows invalid delivery system types other than SYS_DVBS2 and SYS_DVBS. Fix this by returning -EINVAL for invalid values. Signed-off-by: Colin Ian King ---

[PATCH] [media] variable name is never null, so remove null check

2016-09-06 Thread Colin King
From: Colin Ian King The variable name is always assigned to a literal string in the proceeding switch statement, so it is never null and hence the null check is redundant. Remove null the check. Signed-off-by: Colin Ian King ---

[PATCH] [media] lgdt3306a: fix spelling mistake "supportted" -> "supported"

2016-09-01 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in pr_warn message. Signed-off-by: Colin Ian King --- drivers/media/dvb-frontends/lgdt3306a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] [media] rc/streamzap: fix spelling mistake "sumbiting" -> "submitting"

2016-09-01 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in dev_err message. Signed-off-by: Colin Ian King --- drivers/media/rc/streamzap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/rc/streamzap.c

[PATCH] [media] VPU: mediatek: fix null pointer dereference on pdev

2016-09-07 Thread Colin King
From: Colin Ian King pdev is being null checked, however, prior to that it is being dereferenced by platform_get_drvdata. Move the assignments of vpu and run to after the pdev null check to avoid a potential null pointer dereference. Signed-off-by: Colin Ian King

[PATCH] [media] st-hva: fix a copy-and-paste variable name error

2016-09-19 Thread Colin King
From: Colin Ian King The second check for an error on hva->lmi_err_reg appears to be a copy-and-paste error, it should be hva->emi_err_reg instead. Signed-off-by: Colin Ian King --- drivers/media/platform/sti/hva/hva-hw.c | 2 +- 1 file

[PATCH] [media] zoran: fix spelling mistake in dprintk message

2016-11-12 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake "unnsupported" to "unsupported" in debug message. Signed-off-by: Colin Ian King --- drivers/media/pci/zoran/zoran_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] [media] VPU: mediatek: fix dereference of pdev before checking it is null

2016-11-16 Thread Colin King
From: Colin Ian King pdev is dereferenced using platform_get_drvdata before a check to see if it is null, hence there could be a potential null pointer dereference issue. Instead, first check if pdev is null and only then deference pdev when initializing vpu. Found

[PATCH] [media] gspca_stv06xx: remove redundant check for err < 0

2017-01-11 Thread Colin King
From: Colin Ian King The comparison of err < 0 is redundant as err has been previously been assigned to 0 and has not changed. Remove the redundant check. Fixes CoverityScan CID#703363 ("Logically dead code") Signed-off-by: Colin Ian King

[PATCH][V3] [media] gp8psk: fix spelling mistake: "firmare" -> "firmware"

2016-12-30 Thread Colin King
From: Colin Ian King trivial fix to spelling mistake in err message Signed-off-by: Colin Ian King --- drivers/media/usb/dvb-usb/gp8psk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/dvb-usb/gp8psk.c

[PATCH] [media] b2c2: fix spelling mistake: "Contunuity" -> "Continuity"

2016-12-29 Thread Colin King
From: Colin Ian King trivial fix to spelling mistake in deb_chk message Signed-off-by: Colin Ian King --- drivers/media/pci/b2c2/flexcop-pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH][V2] [media] gp8psk: fix spelling mistake: "firmare" -> "firmware"

2016-12-29 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in err message. Also change "don't" to "does not". Signed-off-by: Colin Ian King --- drivers/media/usb/dvb-usb/gp8psk.c | 2 +- drivers/net/wireless/realtek/rtlwifi/core.c | 2 +-

[PATCH] [media] gp8psk: fix spelling mistake: "firmare" -> "firmware"

2016-12-29 Thread Colin King
From: Colin Ian King trivial fix to spelling mistake in err message Signed-off-by: Colin Ian King --- drivers/media/usb/dvb-usb/gp8psk.c | 2 +- drivers/net/wireless/realtek/rtlwifi/core.c | 2 +- 2 files changed, 2 insertions(+), 2

[PATCH] [media] dvb-frontends: fix spelling mistake on cx24123_pll_calcutate

2016-12-28 Thread Colin King
From: Colin Ian King trivial fix to spelling mistake of function name in err message, should be cx24123_pll_calculate instead of cx24123_pll_calcutate. Signed-off-by: Colin Ian King --- drivers/media/dvb-frontends/cx24123.c | 2 +- 1 file

[PATCH] [media] cobalt: fix spelling mistake: "Celcius" -> "Celsius"

2016-12-28 Thread Colin King
From: Colin Ian King trivial fix to spelling mistake in cobalt_info message. Anders Celsius was the Swedish astronomer. Signed-off-by: Colin Ian King --- drivers/media/pci/cobalt/cobalt-cpld.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH] [media] usb: au0828: remove redundant code

2017-03-22 Thread Colin King
From: Colin Ian King The check for ret being non-zero is false as ret is always zero, hence we have redundant dead code that can be removed. Detected with CoverityScan, CID#112968 ("Constant' variable guards dead code (DEADCODE)'") Signed-off-by: Colin Ian King

[PATCH] staging/atomisp: fix spelling mistake: "falied" -> "failed"

2017-03-30 Thread Colin King
From: Colin Ian King trivial fix to spelling mistake in dev_err error message Signed-off-by: Colin Ian King --- drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] [media] coda: remove redundant call to v4l2_m2m_get_vq

2017-03-23 Thread Colin King
From: Colin Ian King The call to v4ls_m2m_get_vq is only used to get the return value which is not being used, so it appears to be redundant and can be removed. Detected with CoverityScan, CID#1420674 ("Useless call") Signed-off-by: Colin Ian King

[PATCH] [media] xc5000: fix spelling mistake: "calibration"

2017-04-12 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake on calibration, make Self lowercase and re-join multiple lined printk since checkpatch allows this coding style. Signed-off-by: Colin Ian King --- drivers/media/tuners/xc5000.c | 3 +-- 1

[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 ---

[PATCH] staging: atomisp: clean up return logic, remove redunant code

2017-03-11 Thread Colin King
From: Colin Ian King There is no need to check if ret is non-zero, remove this redundant check and just return the error status from the call to mt9m114_write_reg_array. Detected by CoverityScan, CID#1416577 ("Identical code for different branches") Signed-off-by:

[PATCH] staging: atomisp: remove redundant check for client being null

2017-03-11 Thread Colin King
From: Colin Ian King The previous statement checks if client is null, so the null check when assigning dev is redundant and can be removed. Detected by CoverityScan, CID#1416555 ("Logically Dead Code") Signed-off-by: Colin Ian King ---

[PATCH] staging: atomisp: fix missing break in switch statement

2017-03-13 Thread Colin King
From: Colin Ian King I believe there is a missing break in the switch statement for case V4L2_CID_FOCUS_STATUS as the current fall-through looks suspect to me. Detected by CoverityScan, CID#1416580 ("Missing break in switch") Signed-off-by: Colin Ian King

[PATCH] staging/atomisp: remove redundant null check on frame

2017-03-13 Thread Colin King
From: Colin Ian King There is no need to perform a null check on frame as there is an earlier null check check and return hence making the null check redundant. Remove it. Detected by CoverityScan, CID#1416563 ("Logically Dead Code") Signed-off-by: Colin Ian King

[PATCH] [media] atmel-isc: fix off-by-one comparison and out of bounds read issue

2017-03-07 Thread Colin King
From: Colin Ian King The are only HIST_ENTRIES worth of entries in hist_entry however the for-loop is iterating one too many times leasing to a read access off the end off the array ctrls->hist_entry. Fix this by iterating by the correct number of times. Detected by

[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 ---

[PATCH] [media] fc001[23]: make const gain table arrays static

2017-07-11 Thread Colin King
From: Colin Ian King Don't populate the gain tables on the stack but make them static const. Makes the object code smaller: Before: textdata bss dec hex filename 78011408 0920923f9 drivers/media/tuners/fc0012.o 8483 936

[PATCH] 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

[PATCH] [media] smiapp: make various const arrays static

2017-07-10 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 and saves nearly 550 bytes. Before: textdata bss dec hex filename 3638 752 043901126 smiapp-quirk.o After:

[PATCH] [media] solo6x10: make const array saa7128_regs_ntsc static

2017-07-10 Thread Colin King
From: Colin Ian King Don't populate const array saa7128_regs_ntsc on the stack but insteaed make it static. Makes the object code smaller and saves nearly 840 bytes Before: textdata bss dec hex filename 9218 360 09578256a

[PATCH] [media] drxd: make const arrays slowIncrDecLUT and fastIncrDecLUT static

2017-07-13 Thread Colin King
From: Colin Ian King Don't populate arrays slowIncrDecLUT and fastIncrDecLUT on the stack but instead make them static. Makes the object code smaller by over 100 bytes: textdata bss dec hex filename 27776 832 64 286727000 drxd_hard.o

[PATCH] [media] drxj: make several const arrays static

2017-07-13 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 over 1800 bytes: Before: textdata bss dec hex filename 941009160 0 103260 1935c drxj.o After: textdata

[PATCH] [media] dib0090: make const array dib0090_tuning_table_cband_7090e_aci static

2017-07-13 Thread Colin King
From: Colin Ian King Don't populate array dib0090_tuning_table_cband_7090e_aci on the stack but instead make it static. Makes the object code smaller by over 180 bytes: Before: textdata bss dec hex filename 400527320 192 47564b9cc

[PATCH] [media] dvb-frontends/cxd2841er: make several arrays static

2017-07-10 Thread Colin King
From: Colin Ian King Don't populate arrays on the stack but make them static. Makes the object code smaller: Before: textdata bss dec hex filename 89299 21704 64 111067 1b1db cxd2841er.o After: textdata bss dec hex

[PATCH][media-next] media: v4l: make local function v4l2_fwnode_endpoint_parse_csi1_bus static

2017-07-20 Thread Colin King
From: Colin Ian King The function v4l2_fwnode_endpoint_parse_csi1_bus does not need to be in global scope, so make it static. Also reformat the function arguments as adding the static keyword made one of the source lines more than 80 chars wide and checkpatch does not

[PATCH] [media] dvb_frontend: ensure that front end status is initialized

2017-07-20 Thread Colin King
From: Colin Ian King The fe_status variable s is not initialized meaning it can have any random garbage status. This could be problematic if fe->ops.tune is false as s is not updated by the call to fe->ops.tune() and a subsequent check on the change status will using a

[PATCH][V2] dvb_frontend: ensure that inital front end status initialized

2017-07-20 Thread Colin King
From: Colin Ian King The fe_status variable s is not initialized meaning it can have any random garbage status. This could be problematic if fe->ops.tune is false as s is not updated by the call to fe->ops.tune() and a subsequent check on the change status will using a

[PATCH] dvb_frontend: initialize variable s with FE_NONE instead of 0

2017-07-21 Thread Colin King
From: Colin Ian King In a previous commit, we added FE_NONE as an unknown fe_status. Initialize variable s to FE_NONE instead of the more opaque value 0. Signed-off-by: Colin Ian King --- drivers/media/dvb-core/dvb_frontend.c | 2 +- 1 file

[PATCH] [media] docs-next: update the fe_status documentation for FE_NONE

2017-07-21 Thread Colin King
From: Colin Ian King Recently added FE_NONE to the enum fe_status, so update the documentation accordingly. Signed-off-by: Colin Ian King --- Documentation/media/uapi/dvb/fe-read-status.rst | 20 ++-- 1 file changed, 14

[PATCH][media-next] media: dvb-frontends/stv0910: make various local variables static

2017-07-21 Thread Colin King
From: Colin Ian King The list stvlist and arrays padc_lookup, s1_sn_lookup and s2_sn_lookup do not need to be in global scope, so make them all static. Cleans up a bunch of smatch warnings: symbol 'padc_lookup' was not declared. Should it be static? symbol

[PATCH] [media] media: i2c: m5mols: fix spelling mistake: "Machanics" -> "Mechanics"

2017-07-03 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in v4l2_info message Signed-off-by: Colin Ian King --- drivers/media/i2c/m5mols/m5mols_core.c | 2 +- drivers/scsi/qedi/qedi_fw.c| 2 +- 2 files changed, 2 insertions(+), 2

[PATCH] [media] uvcvideo: fix spelling mistake: "entites" -> "entities"

2017-07-03 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in uvc_printk message Signed-off-by: Colin Ian King --- drivers/media/usb/uvc/uvc_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] [media] media/i2c/saa717x: fix spelling mistake: "implementd" -> "implemented"

2017-07-03 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in v4l2_dbg debug message Signed-off-by: Colin Ian King --- drivers/media/i2c/saa717x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/saa717x.c

[PATCH] [media] cx18: fix spelling mistake: "demodualtor" -> "demodulator"

2017-04-25 Thread Colin King
From: Colin Ian King trivial fix to spelling mistake and add in a white space in a CX18_ERR error message Signed-off-by: Colin Ian King --- drivers/media/pci/cx18/cx18-dvb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] [media] em28xx: calculate left volume level correctly

2017-08-22 Thread Colin King
From: Colin Ian King The calculation of the left volume looks suspect, the value of 0x1f - ((val << 8) & 0x1f) is always 0x1f. The debug prior to the assignemnt of value[1] prints the left volume setting using the calculation 0x1f - (val >> 8) & 0x1f which looks correct

[PATCH] [media] s5p-mfc: fix spelling mistake: "destionation" -> "destination"

2017-05-14 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in mfc_err error messages Signed-off-by: Colin Ian King --- drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c | 2 +- drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c | 2 +- 2 files changed,

[PATCH][media-next] media: venus: fix loop wrap in cleanup of clks

2017-06-22 Thread Colin King
From: Colin Ian King The current pre-decrement is incorrect and should be replaced with a post-decrement. Consider the case where the very first clk_prepare_enable fails when i is 0; in this case the error clean up will decrement the unsigned int which wraps to the

[PATCH] [media] em28xx: fix spelling mistake: "missdetected" -> "misdetected"

2017-05-22 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in dev_err message Signed-off-by: Colin Ian King --- drivers/media/usb/em28xx/em28xx-cards.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH] [media] rainshadow-cec: ensure exit_loop is initialized

2017-05-19 Thread Colin King
From: Colin Ian King exit_loop is not being initialized, so it contains garbage. Ensure it is initialized to false. Detected by CoverityScan, CID#1436409 ("Uninitialzed scalar variable") Fixes: ea6a69defd3311 ("[media] rainshadow-cec: avoid -Wmaybe-uninitialized

[PATCH][V2] [media] rainshadow-cec: ensure exit_loop is intialized

2017-05-19 Thread Colin King
From: Colin Ian King exit_loop is not being initialized, so it contains garbage. Ensure it is initialized to false. Detected by CoverityScan, CID#1436409 ("Uninitialized scalar variable") Fixes: ea6a69defd3311 ("[media] rainshadow-cec: avoid -Wmaybe-uninitialized

[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

[PATCH] [media] pvrusb2: remove redundant check on cnt > 8

2017-05-07 Thread Colin King
From: Colin Ian King The 2nd check of cnt > 8 is redundant as cnt is already checked and thresholded to a maximum of 8 a few statements earlier. Remove this redundant 2nd check. Detected by CoverityScan, CID#114281 ("Logically dead code") Signed-off-by: Colin Ian King

[PATCH] [media] cxusb: pass buf as a const u8 * pointer and make buf static const

2017-09-18 Thread Colin King
From: Colin Ian King Don't populate the read-only u8 array buf on the stack at run time but instead make it static const; makes object code smaller saving over 480 bytes: Before: textdata bss dec hex filename 33030 65936 192 99158 18356

[PATCH] media: dvb_ca_en50221: sanity check slot number from userspace

2017-09-20 Thread Colin King
From: Colin Ian King Currently a user can pass in an unsanitized slot number which will lead to and out of range index into ca->slot_info. Fix this by checking that the slot number is no more than the allowed maximum number of slots. Seems that this bug has been in the

[PATCH] dma-buf: remove redundant initialization of sg_table

2017-09-14 Thread Colin King
From: Colin Ian King sg_table is being initialized and is never read before it is updated again later on, hence making the initialization redundant. Remove the initialization. Detected by clang scan-build: "warning: Value stored to 'sg_table' during its initialization

[PATCH] media: cx23885: make const array buf static, reduces object code size

2017-09-07 Thread Colin King
From: Colin Ian King Don't populate the array buf on the stack, instead make it static. Makes the object code smaller by over 240 bytes: Before: textdata bss dec hex filename 21689 22992 416 45097b029 cx23885-cards.o After: text

[PATCH] [media] tuners: mxl5005s: make arrays static const, reduces object code size

2017-09-08 Thread Colin King
From: Colin Ian King Don't populate the arrays RegAddr on the stack, instead make them static const. Makes the object code smaller by over 980 bytes: Before: textdata bss dec hex filename 64923 304 0 65227fecb

[PATCH] [media] cobalt: remove redundant zero check on retval

2017-09-05 Thread Colin King
From: Colin Ian King The error handling paths all end up with retval being non-zero, so the check for retval being zero is always false and hence is redundant. Remove it. Detected by CoverityScan CID#1309479 ("Logically dead code") Signed-off-by: Colin Ian King

[PATCH] [media] ov9640: make const arrays res_x/y static const, reduces object code size

2017-09-06 Thread Colin King
From: Colin Ian King Don't populate the arrays res_x and resy_y on the stack, instead make them static const. Makes the object code smaller by over 160 bytes: Before: textdata bss dec hex filename 105092800 64 13373343d ov9640.o

[PATCH] [media] ov2640: make array reset_seq static, reduces object code size

2017-09-12 Thread Colin King
From: Colin Ian King Don't populate the array reset_seq on the stack, instead make it static. Makes the object code smaller by over 50 bytes: Before: textdata bss dec hex filename 117376000 64 178014589 drivers/media/i2c/ov2640.o

[PATCH] [media] gspca: make arrays static, reduces object code size

2017-09-12 Thread Colin King
From: Colin Ian King Don't populate const arrays on the stack, instead make them static. Makes the object code smaller by over 5200 bytes: Before: textdata bss dec hex filename 582598880 128 67267 106c3 ov519.o After: textdata

[PATCH][media-next] media: qcom: camss: Make function vfe_set_selection static

2017-08-29 Thread Colin King
From: Colin Ian King The function vfe_set_selection is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: warning: symbol 'vfe_set_selection' was not declared. Should it be static? Signed-off-by: Colin Ian King

[PATCH] [media] rtl28xxu: make array rc_nec_tab static const

2017-09-01 Thread Colin King
From: Colin Ian King Don't populate the array rc_nec_tab on the stack, instead make it static const. Makes the object code smaller by over 620 bytes: Before: textdata bss dec hex filename 49511 17040 64 66615 10437 rtl28xxu.o After:

[PATCH] [media] imon: make two const arrays static, reduces object code size

2017-09-05 Thread Colin King
From: Colin Ian King Don't populate the const arrays vfd_packet6 and fp_packet on the stack, instead make them static. Makes the object code smaller by over 600 bytes: Before: textdata bss dec hex filename 43794 179201024 62738f512

[PATCH] [media] cx25840: make array stds static const, reduces object code size

2017-09-05 Thread Colin King
From: Colin Ian King Don't populate the array syds on the stack, instead make it static const. Makes the object code smaller by over 280 bytes: Before: textdata bss dec hex filename 81451 12784 704 94939 172db cx25840-core.o text

[PATCH] [media] dvb_frontend: remove redundant status self assignment

2017-11-23 Thread Colin King
From: Colin Ian King The assignment status to itself is redundant and can be removed. Detected with Coccinelle. Signed-off-by: Colin Ian King --- drivers/media/dvb-frontends/drxd_hard.c| 3 --- drivers/media/dvb-frontends/tda18271c2dd.c

[PATCH][next] media: lirc: don't kfree the uninitialized pointer txbuf

2017-12-19 Thread Colin King
From: Colin Ian King The current error exit path if ir_raw_encode_scancode fails is via the label out_kfree which kfree's an uninitialized pointer txbuf. Fix this by exiting via a new exit path that does not kfree txbuf. Also exit via this new exit path for a failed

[PATCH] [media] stb0899: remove redundant self assignment of k_indirect

2017-11-21 Thread Colin King
From: Colin Ian King The self assignment of k_indirect is redundant and can be removed. Detected using coccinelle. Signed-off-by: Colin Ian King --- drivers/media/dvb-frontends/stb0899_algo.c | 3 +-- 1 file changed, 1 insertion(+), 2

[PATCH] [media] dvb-frontends/stv0367: remove redundant self assignment of temporary

2017-11-21 Thread Colin King
From: Colin Ian King The self assignment of temporary is redundant and can be removed. Detected using coccinelle. Signed-off-by: Colin Ian King --- drivers/media/dvb-frontends/stv0367.c | 2 -- 1 file changed, 2 deletions(-) diff --git

[PATCH] media: drxd: make const array fastIncrDecLUT static

2017-11-02 Thread Colin King
From: Colin Ian King Don't populate array fastIncrDecLUT on the stack but instead make it static. Makes the object code smaller by over 360 bytes: textdata bss dec hex filename 32680 944 64 336888398 drxd_hard.o textdata

[PATCH] [media] cx88: make const arrays default_addr_list and pvr2000_addr_list static

2017-11-02 Thread Colin King
From: Colin Ian King Don't populate arrays default_addr_list and pvr2000_addr_list on the stack but instead make them static. Makes the object code smaller by over 340 bytes: Before: textdata bss dec hex filename 125202800 64 15384

[PATCH] [media] au0828: make const array addr_list static

2017-11-02 Thread Colin King
From: Colin Ian King Don't populate array addr_list on the stack but instead make it static. Makes the object code smaller by over 360 bytes: Before: textdata bss dec hex filename 80361488 192971625f4 au0828-input.o After: text

[PATCH 5/7] pwc: fix spelling mistake: "synchronuously" -> "synchronously"

2017-11-02 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in error message text and break line to clean up checkpatch warning Signed-off-by: Colin Ian King --- drivers/media/usb/pwc/pwc-if.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)

[PATCH 2/7] cx231xx: fix spelling mistake: "synchronuously" -> "synchronously"

2017-11-02 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in error message text Signed-off-by: Colin Ian King --- drivers/media/usb/cx231xx/cx231xx-dvb.c | 4 ++-- drivers/media/usb/cx231xx/cx231xx-vbi.c | 4 ++--

[PATCH 3/7] em28xx: fix spelling mistake: "synchronuously" -> "synchronously"

2017-11-02 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in error message text Signed-off-by: Colin Ian King --- drivers/media/usb/em28xx/em28xx-dvb.c | 4 ++-- drivers/media/usb/em28xx/em28xx-video.c | 4 ++-- 2 files changed, 4

[PATCH 4/7] msi2500: fix spelling mistake: "synchronuously" -> "synchronously"

2017-11-02 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in error message text Signed-off-by: Colin Ian King --- drivers/media/usb/msi2500/msi2500.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 1/7] au0828: fix spelling mistake: "synchronuously" -> "synchronously"

2017-11-02 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in error message text Signed-off-by: Colin Ian King --- drivers/media/usb/au0828/au0828-video.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH 6/7] stk1160: fix spelling mistake: "synchronuously" -> "synchronously"

2017-11-02 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in error message text Signed-off-by: Colin Ian King --- drivers/media/usb/stk1160/stk1160-video.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH 7/7] tm6000: fix spelling mistake: "synchronuously" -> "synchronously"

2017-11-02 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in error message text Signed-off-by: Colin Ian King --- drivers/media/usb/tm6000/tm6000-dvb.c | 4 ++-- drivers/media/usb/tm6000/tm6000-video.c | 4 ++-- 2 files changed, 4

[PATCH] media: imx274: fix missing return assignment from call to imx274_mode_regs

2017-11-03 Thread Colin King
From: Colin Ian King The variable ret is being checked for failure however it is not being set from the return status from the call to imx274_mode_regs. Currently ret is alwayus zero and the check is redundant. Fix this by assigning it. Detected by CoverityScan,

[PATCH] media: v4l: async: fix return of unitialized variable ret

2017-11-03 Thread Colin King
From: Colin Ian King A shadow declaration of variable ret is being assigned a return error status and this value is being lost when the error exit goto's jump out of the local scope. This leads to an uninitalized error return value in the outer scope being returned. Fix

[PATCH] [media] mxl111sf: remove redundant assignment to index

2017-10-29 Thread Colin King
From: Colin Ian King Variable index is set to zero and then set to zero again a few lines later in a for loop initialization. Remove the redundant setting of index to zero. Cleans up the clang warning: drivers/media/usb/dvb-usb-v2/mxl111sf-i2c.c:519:3: warning: Value

[PATCH] [media] bdisp: remove redundant assignment to pix

2017-10-29 Thread Colin King
From: Colin Ian King Pointer pix is being initialized to a value and a little later being assigned the same value again. Remove the redundant second duplicate assignment. Cleans up the clang warning: drivers/media/platform/sti/bdisp/bdisp-v4l2.c:726:26: warning: Value

[PATCH] [media] gspca: remove redundant assignment to variable j

2017-10-29 Thread Colin King
From: Colin Ian King Variable j is being set to zero before a loop and also immediately inside the loop and is not used after the loop. Hence the first assignment is redundant and can be removed. Cleans up clang warning: drivers/media/usb/gspca/gspca.c:1078:2: warning:

[PATCH][V2] bdisp: remove redundant assignment to pix

2017-10-29 Thread Colin King
From: Colin Ian King Pointer pix is being initialized to a value and a little later being assigned the same value again. Remove the initial assignment to avoid a duplicate assignment. Cleans up the clang warning: drivers/media/platform/sti/bdisp/bdisp-v4l2.c:726:26:

[PATCH] [media] pt3: remove redundant assignment to mask

2017-10-31 Thread Colin King
From: Colin Ian King Variable mask is being set to 0x80 and then set to this value again in the following for-loop. Remove the extraneous first setting of mask. Cleans up clang warning: drivers/media/pci/pt3/pt3_i2c.c:88:2: warning: Value stored to 'mask' is never read

[PATCH] [media] drivers/media/pci/zoran: remove redundant assignment to pointer h

2017-10-31 Thread Colin King
From: Colin Ian King The pointer h is already initialized to codeclist_top so the second identical assignment is redundant and can be removed. Cleans up clang warning: drivers/media/pci/zoran/videocodec.c:322:21: warning: Value stored to 'h' during its initialization

[PATCH][media-next] media: ddbridge: avoid out-of-bounds write on array demod_in_use

2018-05-07 Thread Colin King
From: Colin Ian King In function stop there is a check to see if state->demod is a stopped value of 0xff, however, later on, array demod_in_use is indexed with this value causing an out-of-bounds write error. Avoid this by only writing to array demod_in_use if

  1   2   >