[PATCH] media: em28xx-input: make const array addr_list static

2019-03-08 Thread Colin King
From: Colin Ian King Don't populate the array addr_list on the stack but instead make it static. Makes the object code smaller by 20 bytes Before: textdata bss dec hex filename^M 169293626 384 2093951cb ../usb/em28xx/em28xx-input.o After: textdata b

[PATCH] [media] wl128x: fix spelling mistake: "Swtich" -> "Switch"

2019-02-17 Thread Colin King
From: Colin Ian King There is a spelling mistake in a fmdbg debug message. Fix it. Signed-off-by: Colin Ian King --- drivers/media/radio/wl128x/fmdrv_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/radio/wl128x/fmdrv_common.c b/drivers/media/radio/wl

[PATCH] media: exynos4-is: remove redundant check on type

2019-02-13 Thread Colin King
From: Colin Ian King The check to see if type is V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE is redundant as this has been already checked at the start of the function and if it's not that value then -ENOSYS is returned. Hence the sprintf can be replaced by a simpler string copy. Detected by CoverityScan

[PATCH][media-next] media: vb2: remove unused variable i

2019-02-01 Thread Colin King
From: Colin Ian King Variable i is declared and never used. Fix this by removing it. Signed-off-by: Colin Ian King --- drivers/media/common/videobuf2/videobuf2-core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/vide

[PATCH][next] media: staging: intel-ipu3: fix unsigned comparison with < 0

2018-12-22 Thread Colin King
From: Colin Ian King The comparison css->pipes[pipe].bindex < 0 is always false because bindex is an unsigned int. Fix this by using a signed integer for the comparison. Detected by CoverityScan, CID#1476023 ("Unsigned compared against 0") Fixes: f5f2e4273518 ("media: staging/intel-ipu3: Add c

[PATCH][next] media: cxd2880-spi: fix two memory leaks of dvb_spi

2018-12-22 Thread Colin King
From: Colin Ian King There are two return paths that do not kfree dvb_spi. Fix the memory leaks by returning via the exit label fail_adapter that will free dvi_spi. Detected by CoverityScan, CID#1475991 ("Resource Leak") Fixes: cb496cd472af ("media: cxd2880-spi: Add optional vcc regulator") Sig

[PATCH][media-next] media: sun6i: fix spelling mistake "droped" -> "dropped"

2018-11-29 Thread Colin King
From: Colin Ian King There are spelling mistakes in dev_dbg messages, fix them. Signed-off-by: Colin Ian King --- drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c b

[PATCH] media: pvrusb2: fix spelling mistake "statuss" -> "status"

2018-11-29 Thread Colin King
From: Colin Ian King There is a spelling mistake in a pvr2_trace trace message, fix it. Signed-off-by: Colin Ian King --- drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvr

[PATCH] [media] tda7432: fix spelling mistake "maximium" -> "maximum"

2018-11-28 Thread Colin King
From: Colin Ian King There is a spelling mistake in the module description as well as a comment. Fix them. Signed-off-by: Colin Ian King --- drivers/media/i2c/tda7432.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/tda7432.c b/drivers/media/i2c/tda74

[PATCH] media: dib0700: fix spelling mistake "Amplifyer" -> "Amplifier"

2018-11-25 Thread Colin King
From: Colin Ian King There is a spelling mistake in the MODULE_PARM_DESC text, fix it. Signed-off-by: Colin Ian King --- drivers/media/usb/dvb-usb/dib0700_devices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/dvb-usb/dib0700_devices.c b/drivers/media/

[PATCH] media: staging: tegra-vde: print long unsigned using %lu format specifier

2018-11-08 Thread Colin King
From: Colin Ian King The frame.flags & FLAG_B_FRAME is promoted to a long unsigned because of the use of the BIT() macro when defining FLAG_B_FRAME and causing a build warning. Fix this by using the %lu format specifer. Cleans up warning: drivers/staging/media/tegra-vde/tegra-vde.c:267:5: warnin

[PATCH][staging-next] drivers: staging: cedrus: find ctx before dereferencing it ctx

2018-11-02 Thread Colin King
From: Colin Ian King Currently if count is an invalid value the v4l2_info message will dereference a null ctx pointer to get the dev information. Fix this by finding ctx first and then checking for an invalid count, this way ctxt will be non-null hence avoiding the null pointer dereference. Dete

[PATCH] media: em28xx: fix spelling mistake, "Cinnergy" -> "Cinergy"

2018-10-12 Thread Colin King
From: Colin Ian King Fix name of the Hybrid T USB XS em28xx card, should be Cinergy. Signed-off-by: Colin Ian King --- Documentation/media/v4l-drivers/em28xx-cardlist.rst | 2 +- drivers/media/usb/em28xx/em28xx-cards.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff

[PATCH] media: dib0700: fix spelling mistake "Amplifyer" -> "Amplifier"

2018-10-12 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in MODULE_PARM_DESC text Signed-off-by: Colin Ian King --- drivers/media/usb/dvb-usb/dib0700_devices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/dvb-usb/dib0700_devices.c b/drivers/media/usb/dvb-u

[PATCH] [media] exynos4-is: fix spelling mistake ACTURATOR -> ACTUATOR

2018-10-12 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in macro name and text string ERROR_SENSOR_ACTURATOR_INIT_FAIL -> ERROR_SENSOR_ACTUATOR_INIT_FAIL Signed-off-by: Colin Ian King --- drivers/media/platform/exynos4-is/fimc-is-errno.c | 4 ++-- drivers/media/platform/exynos4-is/fimc-is-errno.h

[PATCH] media: cx231xx: fix potential sign-extension overflow on large shift

2018-10-06 Thread Colin King
From: Colin Ian King Shifting the u8 value[3] by an int can lead to sign-extension overflow. For example, if value[3] is 0xff and the shift is 24 then it is promoted to int and then the top bit is sign-extended so that all upper 32 bits are set. Fix this by casting value[3] to a u32 before the s

[PATCH 3/4] media: dvb-usb-v2: fix spelling mistake: "completition" -> "completion"

2018-08-03 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in dev_dbg and dev_err messages Signed-off-by: Colin Ian King --- drivers/media/usb/dvb-usb-v2/usb_urb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/dvb-usb-v2/usb_urb.c b/drivers/media/usb/dvb-

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

2018-06-11 Thread Colin King
From: Colin Ian King The check for a zero retval is redundant as all paths that lead to this point have set retval to an error return value that is non-zero. Remove the redundant check. Detected by CoverityScan, CID#102589 ("Logically dead code") Signed-off-by: Colin Ian King --- drivers/medi

[PATCH] media: bt8xx: bttv: fix spelling mistake: "culpit" -> "culprit"

2018-06-11 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in pr_notice message text Signed-off-by: Colin Ian King --- drivers/media/pci/bt8xx/bttv-driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-drive

[PATCH] media: mtk-vpu: fix spelling mistake: "Prosessor" -> "Processor"

2018-05-26 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in module description text. Signed-off-by: Colin Ian King --- drivers/media/platform/mtk-vpu/mtk_vpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/mtk-vpu/mtk_vpu.c b/drivers/media/platform/mtk

[PATCH] [media] hdpvr: fix spelling mistake: "Hauppage" -> "Hauppauge"

2018-05-21 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in name field Signed-off-by: Colin Ian King --- drivers/media/usb/hdpvr/hdpvr-i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/hdpvr/hdpvr-i2c.c b/drivers/media/usb/hdpvr/hdpvr-i2c.c index 4720d79b

[PATCH] media: dvb_frontends: fix spelling mistake: "unexpcted" -> "unexpected"

2018-05-11 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in dprintk message text Signed-off-by: Colin Ian King --- drivers/media/dvb-frontends/l64781.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/dvb-frontends/l64781.c b/drivers/media/dvb-frontends/l64781

[PATCH] [media] cx231xx: Fix spelling mistake: "senario" -> "scenario"

2018-05-09 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/cx231xx/cx231xx-pcb-cfg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/cx231xx/cx231xx-pcb-cfg.c b/drivers/media/usb/cx231xx/cx

[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 state->demod is not set to the stop

[PATCH][media-next][V2] media: davinci_vpfe: fix memory leaks of params

2018-05-02 Thread Colin King
From: Colin Ian King There are memory leaks of params; when copy_to_user fails and also the exit via the label 'error'. Also, there is a bogos memory allocation check on pointer 'to' when memory allocation fails on params. Fix this by kfree'ing params in error exit path and jumping to this on th

[PATCH][media-next] media: davinci_vpfe: fix memory leaks of params

2018-05-02 Thread Colin King
From: Colin Ian King There are memory leaks of params; when copy_to_user fails and also the exit via the label 'error'. Fix this by kfree'ing params in error exit path and jumping to this on the copy_to_user failure path. Detected by CoverityScan, CID#1467966 ("Resource leak") Fixes: da43b6cca

[PATCH] media: atomisp: fix spelling mistake: "diregard" -> "disregard"

2018-04-29 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in ia_css_print message text Signed-off-by: Colin Ian King --- .../css2400/css_2401_csi2p_system/host/csi_rx_private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp2/cs

[PATCH] [media] media/usbvision: fix spelling mistake: "compresion" -> "compression"

2018-04-28 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in proc text string Signed-off-by: Colin Ian King --- drivers/media/usb/usbvision/usbvision-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/usbvision/usbvision-core.c b/drivers/media/usb/usbvisio

[PATCH] media: smiapp: fix timeout checking in smiapp_read_nvm

2018-04-25 Thread Colin King
From: Colin Ian King The current code decrements the timeout counter i and the end of each loop i is incremented, so the check for timeout will always be false and hence the timeout mechanism is just a dead code path. Potentially, if the RD_READY bit is not set, we could end up in an infinite loo

[PATCH][next] media: ispstat: don't dereference user_cfg before a null check

2018-04-24 Thread Colin King
From: Colin Ian King The pointer user_cfg (a copy of new_conf) is dereference before new_conf is null checked, hence we may have a null pointer dereference on user_cfg when assigning buf_size from user_cfg->buf_size. Ensure this does not occur by moving the assignment of buf_size after the null c

[PATCH] media: cec: set ev rather than v with CEC_PIN_EVENT_FL_DROPPED bit

2018-04-18 Thread Colin King
From: Colin Ian King Setting v with the CEC_PIN_EVENT_FL_DROPPED is incorrect, instead ev should be set with this bit. Fix this. Detected by CoverityScan, CID#1467974 ("Extra high-order bits") Fixes: 6ec1cbf6b125 ("media: cec: improve CEC pin event handling") Signed-off-by: Colin Ian King ---

[PATCH] [media] include/media: fix missing | operator when setting cfg

2018-04-18 Thread Colin King
From: Colin Ian King The value from a readl is being masked with ITE_REG_CIOCAN_MASK however this is not being used and cfg is being re-assigned. I believe the assignment operator should actually be instead the |= operator. Detected by CoverityScan, CID#1467987 ("Unused value") Signed-off-by:

[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] media: cx25821: prevent out-of-bounds read on array card

2018-01-31 Thread Colin King
From: Colin Ian King Currently an out of range dev->nr is detected by just reporting the issue and later on an out-of-bounds read on array card occurs because of this. Fix this by checking the upper range of dev->nr with the size of array card (removes the hard coded size), move this check earlie

[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] [media] exynos4-is: make array 'cmd' static, shrinks object size

2018-01-06 Thread Colin King
From: Colin Ian King Don't populate the const read-only array 'cmd' on the stack but instead make it static. Makes the object code smaller by 38 bytes: Before: textdata bss dec hex filename 4950 868 0581816ba fimc-is-regs.o After: textdata bss

[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 allocation of txbuf to avoid

[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 | 1 - 2 files changed, 4 deletions(-) diff --git a/

[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 a/drivers/media/dvb-frontends/stv0367.c b/drivers/media/

[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 deletions(-) diff --git a/drivers/media/dvb-frontends/stb0

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

2017-11-02 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 this by removing the inner

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

2017-11-02 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, CID#1460278 ("Logically dead code

[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: textdata bss dec

[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 153843c18 drivers/media/pci/cx88/c

[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 bss dec hex filenam

[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 insertions(+), 4 deletions(-) diff --git a/drivers/media/usb/em28

[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 a/drivers/media/usb/msi2500/msi2500.c b/drivers/media/usb/msi2500/msi2500.c index

[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 a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au082

[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 ++-- drivers/media/usb/cx231xx/cx231xx-video.c | 4 ++-- 3 files changed, 6 insertions

[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(-) diff --git a/drivers/media/usb/pwc/pwc-if.c b/drive

[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 a/drivers/media/usb/stk1160/stk1160-video.c b/drivers/media/usb/stk1160/

[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 insertions(+), 4 deletions(-) diff --git a/drivers/media/usb/tm60

[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 is never read Signed-off-by

[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 Signed-off-by: Colin Ian

[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: warning: Value stored to 'pix

[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 stored to 'pix' during its

[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: Value stored to 'j' is nev

[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 stored to 'index' is never r

[PATCH] [media] radio-raremono: remove redundant initialization of freq

2017-10-27 Thread Colin King
From: Colin Ian King Variable freq is initialized to f->frequency however this value is never read and freq is later updated; hence the initialization is redundant and can be removed. Cleans up clang warning: drivers/media/radio/radio-raremono.c:257:6: warning: Value stored to 'freq' during its

[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 driver forever. Detected b

[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 drivers/media/usb/dvb-usb/cx

[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 is never read" Signed-off-

[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 bss dec hex fil

[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 After: textdata b

[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 drivers/media/tuners/mxl5005s.o After: text

[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: textdata bss dec he

[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 After: textdata bs

[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 --- drivers/media/pci/cobalt/co

[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 drivers/media/rc/imon.o After

[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 textdata bss dec hex

[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: textdata bss de

[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 --- drivers/media/platform/

[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 to me. Fix the left volume

[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 insertions(+), 6 deletions(-) diff --git a/Documentation/

[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 changed, 1 insertion(+), 1 deletion(-) diff --git a/

[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 's1_sn_lookup' was not declared. Should

[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 garbage value. Fix this by

[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 garbage value. Fix this by

[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 like that. Cleans up spars

[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] [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 dib0090.o After: textd

[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 bss dec hex fi

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

[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 drivers/staging/fbtft/fb_st7789v.o After: textda

[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 0941924cb drive

[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 solo6x10-tw28.o After: text

[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: textdata bss

[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 filename 85823 23432

[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 a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index 708

[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 b/drivers/media/i2c/saa717x.c index e1f6bc219c64..102467e

[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 deletions(-) diff --git a/drivers/media/i2c/m5mols/m5mo

[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 largest unsigned int value caus

[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] [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 a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-c

[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 warning") Signed-off-by: Colin

[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 warning") Signed-off-by: Colin

[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, 2 insertions(+), 2 deletions(-) diff --git a/driver

[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 --- drivers/media/usb/pv

[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 a/drivers/media/pci/cx18/cx18-dvb.c b/drivers/media/p

[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

  1   2   >