summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-04-20media: rc: add ioctl to get the current timeoutSean Young4-5/+23
Since the kernel now modifies the timeout, make it possible to retrieve the current value. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-20media: rc: set timeout to smallest value required by enabled protocolsSean Young13-7/+47
The longer the IR timeout, the longer the rc device waits until delivering the trailing space. So, by reducing this timeout, we reduce the delay for the last scancode to be delivered. Note that the lirc daemon disables all protocols, in which case we revert back to the default value. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-20media: rc: report receiver and transmitter type on device registerSean Young2-3/+21
On the raspberry pi, we might have two lirc devices; one for sending and one for receiving. This change makes it much more apparent which one is which. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-20media: rcar-vin: Fix image alignment for setting pre clippingKoji Matsuoka1-2/+2
In Video Pixel/Line Pre-Clip Register, the setting value can be set in 1 line unit, but it can only be specified as a multiple of 4 by v4l_bound_align_image function(). So correct that it can be specified in 1 line unit with this patch. Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-20media: cec: set ev rather than v with CEC_PIN_EVENT_FL_DROPPED bitColin Ian King1-1/+1
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 <colin.king@canonical.com> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-20media: cx231xx: Add support for AverMedia DVD EZMaker 7Kai-Heng Feng1-0/+3
User reports AverMedia DVD EZMaker 7 can be driven by VIDEO_GRABBER. Add the device to the id_table to make it work. BugLink: https://bugs.launchpad.net/bugs/1620762 Cc: stable@vger.kernel.org Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-20media: omap3isp: fix unbalanced dma_iommu_mappingSuman Anna1-3/+4
The OMAP3 ISP driver manages its MMU mappings through the IOMMU-aware ARM DMA backend. The current code creates a dma_iommu_mapping and attaches this to the ISP device, but never detaches the mapping in either the probe failure paths or the driver remove path resulting in an unbalanced mapping refcount and a memory leak. Fix this properly. Reported-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Suman Anna <s-anna@ti.com> Tested-by: Pavel Machek <pavel@ucw.cz> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-20media: v4l2-compat-ioctl32: better document the codeMauro Carvalho Chehab1-6/+159
This file does a lot of non-trivial struff. Document it using kernel-doc markups where needed and improve the comments inside do_video_ioctl(). Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-20media: v4l2-compat-ioctl32: simplify castsMauro Carvalho Chehab1-11/+25
Making the cast right for get_user/put_user is not trivial, as it needs to ensure that the types are the correct ones. Improve it by using macros. Tested with vivid with: $ sudo modprobe vivid no_error_inj=1 $ v4l2-compliance-32bits -a -s10 >32bits && v4l2-compliance-64bits -a -s10 > 64bits && diff -U0 32bits 64bits --- 32bits 2018-04-17 11:18:29.141240772 -0300 +++ 64bits 2018-04-17 11:18:40.635282341 -0300 @@ -1 +1 @@ -v4l2-compliance SHA : bc71e4a67c6fbc5940062843bc41e7c8679634ce, 32 bits +v4l2-compliance SHA : bc71e4a67c6fbc5940062843bc41e7c8679634ce, 64 bits Using the latest version of v4l-utils with this patch applied: https://patchwork.linuxtv.org/patch/48746/ Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-20media: v4l2-compat-ioctl32: better name userspace pointersMauro Carvalho Chehab1-294/+294
In the past, "up" were an acronym for "user pointer" and "kp" for "kernel pointer". However, since commit a1dfb4c48cc1 ("media: v4l2-compat-ioctl32.c: refactor compat ioctl32 logic"), both are now __user pointers. So, the usage of "kp" is really misleading there. So, rename both to just "p32" and "p64" everywhere it occurs, in order to make peace with this file's namespace. There are two exceptions to "up/kp" nomenclature: at alloc_userspace() and at do_video_ioctl(). There, a new userspace pointer were allocated, in order to store the 64 bits version of the ioctl. Those were called as "up_native", with is, IMHO, an even worse name, as "native" could mislead of being the arguments that were filled from userspace. I almost renamed it to just "p64", but, after thinking more about that, it sounded better to call it as "new_p64", as this makes clearer that this is the data structure that was allocated inside this file in order to be used to pass/retrieve data when calling the 64-bit ready file->f_op->unlocked_ioctl() function. Suggested-by: Sakari Ailus <sakari.ailus@linux.intel.com> Suggested-by: Hans Verkuil <hverkuil@xs4all.nl> Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-20media: v4l2-compat-ioctl32: fix several __user annotationsMauro Carvalho Chehab1-15/+35
Smatch report several issues with bad __user annotations: drivers/media/v4l2-core/v4l2-compat-ioctl32.c:447:21: warning: incorrect type in argument 1 (different address spaces) drivers/media/v4l2-core/v4l2-compat-ioctl32.c:447:21: expected void [noderef] <asn:1>*uptr drivers/media/v4l2-core/v4l2-compat-ioctl32.c:447:21: got void *<noident> drivers/media/v4l2-core/v4l2-compat-ioctl32.c:621:21: warning: incorrect type in argument 1 (different address spaces) drivers/media/v4l2-core/v4l2-compat-ioctl32.c:621:21: expected void const volatile [noderef] <asn:1>*<noident> drivers/media/v4l2-core/v4l2-compat-ioctl32.c:621:21: got struct v4l2_plane [noderef] <asn:1>**<noident> drivers/media/v4l2-core/v4l2-compat-ioctl32.c:693:13: warning: incorrect type in argument 1 (different address spaces) drivers/media/v4l2-core/v4l2-compat-ioctl32.c:693:13: expected void [noderef] <asn:1>*uptr drivers/media/v4l2-core/v4l2-compat-ioctl32.c:693:13: got void *[assigned] base drivers/media/v4l2-core/v4l2-compat-ioctl32.c:871:13: warning: incorrect type in assignment (different address spaces) drivers/media/v4l2-core/v4l2-compat-ioctl32.c:871:13: expected struct v4l2_ext_control [noderef] <asn:1>*kcontrols drivers/media/v4l2-core/v4l2-compat-ioctl32.c:871:13: got struct v4l2_ext_control *<noident> drivers/media/v4l2-core/v4l2-compat-ioctl32.c:957:13: warning: incorrect type in assignment (different address spaces) drivers/media/v4l2-core/v4l2-compat-ioctl32.c:957:13: expected unsigned char [usertype] *__pu_val drivers/media/v4l2-core/v4l2-compat-ioctl32.c:957:13: got void [noderef] <asn:1>* drivers/media/v4l2-core/v4l2-compat-ioctl32.c:973:13: warning: incorrect type in argument 1 (different address spaces) drivers/media/v4l2-core/v4l2-compat-ioctl32.c:973:13: expected void [noderef] <asn:1>*uptr drivers/media/v4l2-core/v4l2-compat-ioctl32.c:973:13: got void *[assigned] edid Fix them. Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-18media: si470x: fix a typo at the Makefile causing build issuesMauro Carvalho Chehab1-1/+1
Instead of +=, the rule had :=, with actually disables build of everything else. Fixes: 58757984ca3c ("media: si470x: allow build both USB and I2C at the same time") Reported-by: Daniel Scheller <d.scheller.oss@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: ddbridge: don't uselessly check for dma in start/stop functionsDaniel Scheller1-50/+35
The check for a valid ptr in ddb_io->dma isn't really necessary since only devices that do data transport using DMA are supported by the driver, and all previous initialisation code (through input_init(), output_init() and dma_init(), has_dma is always true as it's set in ddb_probe() during driver load) guarantees the ptr is set. As a side effect, this silences these sparse warnings (albeit them being false positives as ddb_io->dma won't change in these functions so the condition always equals to the same result): drivers/media/pci/ddbridge/ddbridge-core.c:495:9: warning: context imbalance in 'ddb_output_start' - different lock contexts for basic block drivers/media/pci/ddbridge/ddbridge-core.c:510:9: warning: context imbalance in 'ddb_output_stop' - different lock contexts for basic block drivers/media/pci/ddbridge/ddbridge-core.c:525:9: warning: context imbalance in 'ddb_input_stop' - different lock contexts for basic block drivers/media/pci/ddbridge/ddbridge-core.c:560:9: warning: context imbalance in 'ddb_input_start' - different lock contexts for basic block Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: mantis: prevent staying forever in a loop at IRQMauro Carvalho Chehab1-0/+7
As warned by smatch: drivers/media/pci/mantis/mantis_uart.c:105 mantis_uart_work() warn: this loop depends on readl() succeeding If something goes wrong at readl(), the logic will stay there inside an IRQ code forever. This is not the nicest thing to do :-) So, add a timeout there, preventing staying inside the IRQ for more than 10ms. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: st_rc: Don't stay on an IRQ handler foreverMauro Carvalho Chehab1-6/+10
As warned by smatch: drivers/media/rc/st_rc.c:110 st_rc_rx_interrupt() warn: this loop depends on readl() succeeding If something goes wrong at readl(), the logic will stay there inside an IRQ code forever. This is not the nicest thing to do :-) So, add a timeout there, preventing staying inside the IRQ for more than 10ms. Acked-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: atomisp: get rid of a warningMauro Carvalho Chehab1-1/+1
On smatch, this warning is trigged: drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c:324 __bo_take_off_handling() error: we previously assumed 'bo->prev' could be null (see line 314) Because it can't properly analize the truth table for the above function. So, add an explicit check for the final condition there. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: atomisp: compat32: fix __user annotationsMauro Carvalho Chehab1-23/+26
The __user annotations at the compat32 code is not right: drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:81:18: warning: incorrect type in assignment (different address spaces) drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:81:18: expected void *base drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:81:18: got void [noderef] <asn:1>* drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:232:23: warning: incorrect type in assignment (different address spaces) drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:232:23: expected unsigned int [usertype] *xcoords_y drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:232:23: got void [noderef] <asn:1>* drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:233:23: warning: incorrect type in assignment (different address spaces) drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:233:23: expected unsigned int [usertype] *ycoords_y drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:233:23: got void [noderef] <asn:1>* drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:234:24: warning: incorrect type in assignment (different address spaces) drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:234:24: expected unsigned int [usertype] *xcoords_uv drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:234:24: got void [noderef] <asn:1>* drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:235:24: warning: incorrect type in assignment (different address spaces) drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:235:24: expected unsigned int [usertype] *ycoords_uv drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:235:24: got void [noderef] <asn:1>* drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:296:29: warning: incorrect type in assignment (different address spaces) drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:296:29: expected unsigned int [usertype] *effective_width drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:296:29: got void [noderef] <asn:1>* drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:360:29: warning: incorrect type in assignment (different address spaces) drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:360:29: expected unsigned int [usertype] *effective_width drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:360:29: got void [noderef] <asn:1>* drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:437:19: warning: incorrect type in assignment (different address spaces) drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:437:19: expected struct v4l2_framebuffer *frame drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:437:19: got void [noderef] <asn:1>* drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:481:29: warning: incorrect type in assignment (different address spaces) drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:481:29: expected unsigned short *calb_grp_values drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:481:29: got void [noderef] <asn:1>* drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:701:39: warning: cast removes address space of expression drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:704:21: warning: incorrect type in argument 1 (different address spaces) drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:704:21: expected void const volatile [noderef] <asn:1>*<noident> drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:704:21: got unsigned int [usertype] *src drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:737:43: warning: incorrect type in assignment (different address spaces) drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:737:43: expected struct atomisp_shading_table *shading_table drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:737:43: got void [noderef] <asn:1>* drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:742:44: warning: incorrect type in argument 1 (different address spaces) drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:742:44: expected void [noderef] <asn:1>*to drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:742:44: got struct atomisp_shading_table *shading_table drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:755:41: warning: incorrect type in assignment (different address spaces) drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:755:41: expected struct atomisp_morph_table *morph_table drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:755:41: got void [noderef] <asn:1>* drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:760:44: warning: incorrect type in argument 1 (different address spaces) drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:760:44: expected void [noderef] <asn:1>*to drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:760:44: got struct atomisp_morph_table *morph_table drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:772:40: warning: incorrect type in assignment (different address spaces) drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:772:40: expected struct atomisp_dvs2_coefficients *dvs2_coefs drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:772:40: got void [noderef] <asn:1>* drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:777:44: warning: incorrect type in argument 1 (different address spaces) drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:777:44: expected void [noderef] <asn:1>*to drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:777:44: got struct atomisp_dvs2_coefficients *dvs2_coefs drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:788:46: warning: incorrect type in assignment (different address spaces) drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:788:46: expected struct atomisp_dvs_6axis_config *dvs_6axis_config drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:788:46: got void [noderef] <asn:1>* drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:793:44: warning: incorrect type in argument 1 (different address spaces) drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:793:44: expected void [noderef] <asn:1>*to drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:793:44: got struct atomisp_dvs_6axis_config *dvs_6axis_config drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:853:17: warning: incorrect type in assignment (different address spaces) drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:853:17: expected struct atomisp_sensor_ae_bracketing_lut_entry *lut drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:853:17: got void [noderef] <asn:1>* Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: staging: atomisp: add missing includeMauro Carvalho Chehab1-2/+3
There are two functions used externally: drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:866:6: warning: symbol 'atomisp_do_compat_ioctl' was not declared. Should it be static? drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:1110:6: warning: symbol 'atomisp_compat_ioctl32' was not declared. Should it be static? whose include header is missing. Add it. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: atomisp: compat32: use get_user() before referencing user dataMauro Carvalho Chehab1-38/+0
The logic at get_atomisp_parameters32() is broken, as pointed by smatch: drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:737:21: warning: dereference of noderef expression drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:744:60: warning: dereference of noderef expression drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:763:21: warning: dereference of noderef expression drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:770:60: warning: dereference of noderef expression drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:788:21: warning: dereference of noderef expression drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:795:60: warning: dereference of noderef expression drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:812:21: warning: dereference of noderef expression drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_ioctl32.c:819:60: warning: dereference of noderef expression It tries to access userspace data directly, without calling get_user(). That should generate OOPS. Thankfully, the right logic is already there (although commented out). Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: v4l2-compat-ioctl32: prevent go past max sizeMauro Carvalho Chehab1-1/+1
As warned by smatch: drivers/media/v4l2-core/v4l2-compat-ioctl32.c:879 put_v4l2_ext_controls32() warn: check for integer overflow 'count' The access_ok() logic should check for too big arrays too. Cc: stable@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: platform: fix some 64-bits warningsMauro Carvalho Chehab4-5/+5
The omap/omap3 and viu drivers are for 32 bit platforms only. There, a pointer has 32 bits. Now that those drivers build for 64 bits with COMPILE_TEST, they produce the following warnings: drivers/media/platform/omap/omap_vout_vrfb.c: In function 'omap_vout_allocate_vrfb_buffers': drivers/media/platform/omap/omap_vout_vrfb.c:57:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] memset((void *) vout->smsshado_virt_addr[i], 0, ^ drivers/media/platform/fsl-viu.c: In function 'viu_setup_preview': drivers/media/platform/fsl-viu.c:753:28: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] reg_val.field_base_addr = (u32)dev->ovbuf.base; ^ drivers/media/platform/omap/omap_vout.c: In function 'omap_vout_get_userptr': drivers/media/platform/omap/omap_vout.c:209:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] *physp = virt_to_phys((void *)virtp); ^ drivers/media/platform/omap3isp/ispccdc.c: In function 'ccdc_config': drivers/media/platform/omap3isp/ispccdc.c:738:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] (__force void __user *)fpc.fpcaddr, ^ Add some typecasts to remove those warnings when building for 64 bits. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: atomisp: remove an impossible conditionMauro Carvalho Chehab1-6/+0
Changeset dc9f65cf9aea ("media: staging: atomisp: avoid a warning if 32 bits build") was meant to solve an impossible condition when building with 32 bits. It turns that this impossible condition also happens wit 64 bits: drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c:698 gmin_get_config_var() warn: impossible condition '(*out_len > (~0)) => (0-u64max > u64max)' After a further analysis, this condition will always be false as, on all architectures, size_t doesn't have more bits than unsigned long. Also, the only two archs that really matter are x86 and x86_64, as this driver doesn't build on other archs (as it depends on X86-specific UEFI support). So, just drop the useless code. Fixes: dc9f65cf9aea ("media: staging: atomisp: avoid a warning if 32 bits build") Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: cec: fix smatch errorHans Verkuil1-4/+6
drivers/media/cec/cec-pin-error-inj.c:231 cec_pin_error_inj_parse_line() error: uninitialized symbol 'pos'. The tx-add-bytes command didn't check for the presence of an argument, and also didn't check that it was > 0. This should fix this error. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: v4l2-fwnode: simplify v4l2_fwnode_reference_parse_int_props()Mauro Carvalho Chehab1-10/+18
The logic at v4l2_fwnode_reference_parse_int_props() is somewhat complex and violates Linux coding style, as it does multiple statements on a single line. That makes static analyzers to be confused, as warned by smatch: drivers/media/v4l2-core/v4l2-fwnode.c:832 v4l2_fwnode_reference_parse_int_props() warn: passing zero to 'PTR_ERR' Simplify the logic, in order to make clearer about what happens when v4l2_fwnode_reference_get_int_prop() returns an error. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: dvb_frontend: fix locking issues at dvb_frontend_get_event()Mauro Carvalho Chehab1-8/+15
As warned by smatch: drivers/media/dvb-core/dvb_frontend.c:314 dvb_frontend_get_event() warn: inconsistent returns 'sem:&fepriv->sem'. Locked on: line 288 line 295 line 306 line 314 Unlocked on: line 303 The lock implementation for get event is wrong, as, if an interrupt occurs, down_interruptible() will fail, and the routine will call up() twice when userspace calls the ioctl again. The bad code is there since when Linux migrated to git, in 2005. Cc: stable@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: staging: atomisp: fix string comparation logicMauro Carvalho Chehab2-6/+3
it makes no sense to use strncmp() with a size with is bigger than the string we're comparing with. Fix those warnings: drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c:776 atomisp_open() error: strncmp() '"ATOMISP ISP ACC"' too small (16 vs 32) drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c:913 atomisp_release() error: strncmp() '"ATOMISP ISP ACC"' too small (16 vs 32) drivers/staging/media/atomisp/pci/atomisp2/atomisp_ioctl.c:2751 atomisp_vidioc_default() error: strncmp() '"ATOMISP ISP ACC"' too small (16 vs 32) Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: atomisp: fix __user annotationsMauro Carvalho Chehab15-36/+40
There are lots of troubles with atomisp __user annotations. Fix them. drivers/staging/media/atomisp/pci/atomisp2/atomisp_acc.c:357:49: warning: incorrect type in argument 2 (different address spaces) drivers/staging/media/atomisp/pci/atomisp2/atomisp_acc.c:357:49: expected void *userptr drivers/staging/media/atomisp/pci/atomisp2/atomisp_acc.c:357:49: got void [noderef] <asn:1>*user_ptr drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c:3302:43: warning: incorrect type in argument 2 (different address spaces) drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c:3302:43: expected void const [noderef] <asn:1>*from drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c:3302:43: got void const *from drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c:4070:58: warning: incorrect type in argument 2 (different address spaces) drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c:4070:58: expected void const *from drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c:4070:58: got unsigned short [noderef] <asn:1>*<noident> drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c:4082:58: warning: incorrect type in argument 2 (different address spaces) drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c:4082:58: expected void const *from drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c:4082:58: got unsigned short [noderef] <asn:1>*<noident> drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c:6179:62: warning: incorrect type in argument 2 (different address spaces) drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c:6179:62: expected void const [noderef] <asn:1>*from drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c:6179:62: got unsigned short [usertype] *<noident> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: staging: atomisp: don't declare the same vars as both private and publicMauro Carvalho Chehab4-60/+18
The mmu_private.h header is included at mmu.c, with duplicates the already existing definitions at mmu_public.h. Fix this by removing the erroneous header file. Solve those issues: drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/mmu_private.h:24:26: warning: function 'mmu_reg_store' with external linkage has definition drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/mmu_private.h:35:30: warning: function 'mmu_reg_load' with external linkage has definition drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/mmu_private.h:24:26: warning: function 'mmu_reg_store' with external linkage has definition drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/mmu_private.h:35:30: warning: function 'mmu_reg_load' with external linkage has definition Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: staging: atomisp: fix number conversionMauro Carvalho Chehab2-5/+13
smatch says that there's an issue with number conversion: drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c:4154 sh_css_params_write_to_ddr_internal() warn: '((-(1 << ((14 - 1)))))' 4294959104 can't fit into 32767 'converted_macc_table.data[idx]' drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c:4157 sh_css_params_write_to_ddr_internal() warn: '((-(1 << ((14 - 1)))))' 4294959104 can't fit into 32767 'converted_macc_table.data[idx + 1]' drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c:4160 sh_css_params_write_to_ddr_internal() warn: '((-(1 << ((14 - 1)))))' 4294959104 can't fit into 32767 'converted_macc_table.data[idx + 2]' drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c:4163 sh_css_params_write_to_ddr_internal() warn: '((-(1 << ((14 - 1)))))' 4294959104 can't fit into 32767 'converted_macc_table.data[idx + 3]' drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8.host.c:168 ia_css_eed1_8_vmem_encode() warn: assigning (-8192) to unsigned variable 'to->e_dew_enh_a[0][base + j]' That's probably because min() and max() definition used there are really poor ones. So, replace by the in-kernel macro. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: omap_vout: fix wrong identingMauro Carvalho Chehab1-8/+7
As warned: drivers/media/platform/omap/omap_vout.c:711 omap_vout_buffer_setup() warn: inconsistent indenting Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: fsl-viu: fix __iomem annotationsMauro Carvalho Chehab1-15/+11
Those annotations are wrong, causing this warning: drivers/media/platform/fsl-viu.c:1440:21: warning: incorrect type in assignment (different address spaces) drivers/media/platform/fsl-viu.c:1440:21: expected struct viu_reg *vr drivers/media/platform/fsl-viu.c:1440:21: got struct viu_reg [noderef] <asn:2>*[assigned] viu_regs Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: fsl-viu: use %p to print pointersMauro Carvalho Chehab1-11/+6
Solve those warnings: drivers/media/platform/fsl-viu.c:299 restart_video_queue() warn: argument 3 to %08lx specifier is cast from pointer drivers/media/platform/fsl-viu.c:506 buffer_queue() warn: argument 2 to %08lx specifier is cast from pointer drivers/media/platform/fsl-viu.c:518 buffer_queue() warn: argument 2 to %08lx specifier is cast from pointer drivers/media/platform/fsl-viu.c:528 buffer_queue() warn: argument 2 to %08lx specifier is cast from pointer drivers/media/platform/fsl-viu.c:1219 viu_open() warn: argument 2 to %08lx specifier is cast from pointer drivers/media/platform/fsl-viu.c:1219 viu_open() warn: argument 3 to %08lx specifier is cast from pointer drivers/media/platform/fsl-viu.c:1219 viu_open() warn: argument 4 to %08lx specifier is cast from pointer drivers/media/platform/fsl-viu.c:1329 viu_mmap() warn: argument 2 to %08lx specifier is cast from pointer drivers/media/platform/fsl-viu.c:1334 viu_mmap() warn: argument 2 to %08lx specifier is cast from pointer Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: isppreview: fix __user annotationsMauro Carvalho Chehab1-1/+1
The 'from' variable at preview_config() expects an __user * type. However, the logic there does: from = *(void * __user *) ((void *)cfg + attr->config_offset); With actually means a void pointer, pointing to a void __ user pointer. When the first pointer is de-referenced with *(foo), the type it returns is "void *" instead of "void __user *". Change it to: from = *(void __user **) ((void *)cfg + attr->config_offset); in order to obtain, when de-referenced, a void __user pointer, as desired. That prevent those warnings: drivers/media/platform/omap3isp/isppreview.c:893:45: warning: incorrect type in initializer (different address spaces) drivers/media/platform/omap3isp/isppreview.c:893:45: expected void [noderef] <asn:1>*from drivers/media/platform/omap3isp/isppreview.c:893:45: got void *[noderef] <asn:1><noident> drivers/media/platform/omap3isp/isppreview.c:893:47: warning: dereference of noderef expression Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: ispstat: use %p to print the address of a bufferMauro Carvalho Chehab1-4/+2
Instead of converting to int, use %p. That prevents this warning: drivers/media/platform/omap3isp/ispstat.c:451 isp_stat_bufs_alloc() warn: argument 7 to %08lx specifier is cast from pointer Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: vpbe_display: get rid of warningsMauro Carvalho Chehab1-4/+4
Solve those warnings: drivers/media/platform/davinci/vpbe_display.c:288 vpbe_start_streaming() warn: inconsistent indenting drivers/media/platform/davinci/vpbe_display.c:1356 register_device() warn: argument 3 to %x specifier is cast from pointer drivers/media/platform/davinci/vpbe_display.c:1356 register_device() warn: argument 4 to %x specifier is cast from pointer Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: vpbe_display: properly handle error caseMauro Carvalho Chehab1-2/+2
if v4l2_subdev_call(..., VENC_GET_FLD,...) fails, it currently returns a random value. Instead, return 1. That's probably better than returning 0, as this is very likely what happens in practice with the current code, as as the probably of an unititialized 32 bits integer to have an specific value (0, in this case), is 1/(2^32). An alternative would be to return an error code, and let the caller to hint, based on the past received frame, but that sounds weird. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: mmp-driver: add needed __iomem marks to power_regsMauro Carvalho Chehab1-1/+1
Solve those warnings: drivers/media/platform/marvell-ccic/mmp-driver.c:135:41: warning: incorrect type in argument 2 (different address spaces) drivers/media/platform/marvell-ccic/mmp-driver.c:135:41: expected void [noderef] <asn:2>*<noident> drivers/media/platform/marvell-ccic/mmp-driver.c:135:41: got void * drivers/media/platform/marvell-ccic/mmp-driver.c:136:44: warning: incorrect type in argument 2 (different address spaces) drivers/media/platform/marvell-ccic/mmp-driver.c:136:44: expected void [noderef] <asn:2>*<noident> drivers/media/platform/marvell-ccic/mmp-driver.c:136:44: got void * drivers/media/platform/marvell-ccic/mmp-driver.c:174:38: warning: incorrect type in argument 2 (different address spaces) drivers/media/platform/marvell-ccic/mmp-driver.c:174:38: expected void [noderef] <asn:2>*<noident> drivers/media/platform/marvell-ccic/mmp-driver.c:174:38: got void * drivers/media/platform/marvell-ccic/mmp-driver.c:175:38: warning: incorrect type in argument 2 (different address spaces) drivers/media/platform/marvell-ccic/mmp-driver.c:175:38: expected void [noderef] <asn:2>*<noident> drivers/media/platform/marvell-ccic/mmp-driver.c:175:38: got void * drivers/media/platform/marvell-ccic/mmp-driver.c:195:48: warning: incorrect type in argument 1 (different address spaces) drivers/media/platform/marvell-ccic/mmp-driver.c:195:48: expected void [noderef] <asn:2>*<noident> drivers/media/platform/marvell-ccic/mmp-driver.c:195:48: got void * drivers/media/platform/marvell-ccic/mmp-driver.c:196:55: warning: incorrect type in argument 2 (different address spaces) drivers/media/platform/marvell-ccic/mmp-driver.c:196:55: expected void [noderef] <asn:2>*<noident> drivers/media/platform/marvell-ccic/mmp-driver.c:196:55: got void * drivers/media/platform/marvell-ccic/mmp-driver.c:197:54: warning: incorrect type in argument 2 (different address spaces) drivers/media/platform/marvell-ccic/mmp-driver.c:197:54: expected void [noderef] <asn:2>*<noident> drivers/media/platform/marvell-ccic/mmp-driver.c:197:54: got void * drivers/media/platform/marvell-ccic/mmp-driver.c:202:48: warning: incorrect type in argument 1 (different address spaces) drivers/media/platform/marvell-ccic/mmp-driver.c:202:48: expected void [noderef] <asn:2>*<noident> drivers/media/platform/marvell-ccic/mmp-driver.c:202:48: got void * drivers/media/platform/marvell-ccic/mmp-driver.c:203:55: warning: incorrect type in argument 2 (different address spaces) drivers/media/platform/marvell-ccic/mmp-driver.c:203:55: expected void [noderef] <asn:2>*<noident> drivers/media/platform/marvell-ccic/mmp-driver.c:203:55: got void * drivers/media/platform/marvell-ccic/mmp-driver.c:204:54: warning: incorrect type in argument 2 (different address spaces) drivers/media/platform/marvell-ccic/mmp-driver.c:204:54: expected void [noderef] <asn:2>*<noident> drivers/media/platform/marvell-ccic/mmp-driver.c:204:54: got void * drivers/media/platform/marvell-ccic/mmp-driver.c:389:25: warning: incorrect type in assignment (different address spaces) drivers/media/platform/marvell-ccic/mmp-driver.c:389:25: expected void *power_regs drivers/media/platform/marvell-ccic/mmp-driver.c:389:25: got void [noderef] <asn:2>* Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: davinci: fix an inconsistent identMauro Carvalho Chehab1-2/+3
drivers/media/platform/davinci/vpbe_osd.c:849 try_layer_config() warn: inconsistent indenting Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: isif: reorder a statement to match coding styleMauro Carvalho Chehab1-1/+1
On all places, we do: void <asn_ref> *foo; Here, it is doing, instead: void * <asn_ref> foo; That tricks static analyzers, making it see errors where there's none. So, just reorder in order to cleanup those warnings: drivers/media/platform/davinci/isif.c:1066:22: warning: incorrect type in assignment (different address spaces) drivers/media/platform/davinci/isif.c:1066:22: expected void *[noderef] <asn:2>addr drivers/media/platform/davinci/isif.c:1066:22: got void [noderef] <asn:2>* drivers/media/platform/davinci/isif.c:1074:44: warning: incorrect type in assignment (different address spaces) drivers/media/platform/davinci/isif.c:1074:44: expected void [noderef] <asn:2>*static [toplevel] [assigned] base_addr drivers/media/platform/davinci/isif.c:1074:44: got void *[noderef] <asn:2>addr drivers/media/platform/davinci/isif.c:1078:51: warning: incorrect type in assignment (different address spaces) drivers/media/platform/davinci/isif.c:1078:51: expected void [noderef] <asn:2>*static [toplevel] [assigned] linear_tbl0_addr drivers/media/platform/davinci/isif.c:1078:51: got void *[noderef] <asn:2>addr drivers/media/platform/davinci/isif.c:1082:51: warning: incorrect type in assignment (different address spaces) drivers/media/platform/davinci/isif.c:1082:51: expected void [noderef] <asn:2>*static [toplevel] [assigned] linear_tbl1_addr drivers/media/platform/davinci/isif.c:1082:51: got void *[noderef] <asn:2>addr drivers/media/platform/davinci/isif.c:1067:22: warning: dereference of noderef expression Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: si470x: fix __be16 annotationsMauro Carvalho Chehab1-3/+3
The annotations there are wrong as warned: drivers/media/radio/si470x/radio-si470x-i2c.c:107:35: warning: cast to restricted __be16 drivers/media/radio/si470x/radio-si470x-i2c.c:107:35: warning: cast to restricted __be16 drivers/media/radio/si470x/radio-si470x-i2c.c:107:35: warning: cast to restricted __be16 drivers/media/radio/si470x/radio-si470x-i2c.c:107:35: warning: cast to restricted __be16 drivers/media/radio/si470x/radio-si470x-i2c.c:129:24: warning: incorrect type in assignment (different base types) drivers/media/radio/si470x/radio-si470x-i2c.c:129:24: expected unsigned short [unsigned] [short] <noident> drivers/media/radio/si470x/radio-si470x-i2c.c:129:24: got restricted __be16 [usertype] <noident> drivers/media/radio/si470x/radio-si470x-i2c.c:163:39: warning: cast to restricted __be16 drivers/media/radio/si470x/radio-si470x-i2c.c:163:39: warning: cast to restricted __be16 drivers/media/radio/si470x/radio-si470x-i2c.c:163:39: warning: cast to restricted __be16 drivers/media/radio/si470x/radio-si470x-i2c.c:163:39: warning: cast to restricted __be16 Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: davinci_vpfe: fix __user annotationsMauro Carvalho Chehab3-14/+12
The __user annotations on this driver are wrong, causing lots of warnings: drivers/staging/media/davinci_vpfe/dm365_ipipe.c:1269:22: warning: incorrect type in assignment (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipe.c:1269:22: expected void [noderef] <asn:1>*from drivers/staging/media/davinci_vpfe/dm365_ipipe.c:1269:22: got void *[noderef] <asn:1><noident> drivers/staging/media/davinci_vpfe/dm365_ipipe.c:1313:20: warning: incorrect type in assignment (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipe.c:1313:20: expected void [noderef] <asn:1>*to drivers/staging/media/davinci_vpfe/dm365_ipipe.c:1313:20: got void *[noderef] <asn:1><noident> drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:424:41: warning: incorrect type in initializer (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:424:41: expected struct ipipeif_params *config drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:424:41: got void [noderef] <asn:1>*arg drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:474:46: warning: incorrect type in argument 2 (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:474:46: expected void [noderef] <asn:1>*arg drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:474:46: got void *arg drivers/staging/media/davinci_vpfe/dm365_resizer.c:922:32: warning: incorrect type in argument 2 (different address spaces) drivers/staging/media/davinci_vpfe/dm365_resizer.c:922:32: expected void const [noderef] <asn:1>*from drivers/staging/media/davinci_vpfe/dm365_resizer.c:922:32: got struct vpfe_rsz_config_params *config drivers/staging/media/davinci_vpfe/dm365_resizer.c:945:27: warning: incorrect type in argument 1 (different address spaces) drivers/staging/media/davinci_vpfe/dm365_resizer.c:945:27: expected void [noderef] <asn:1>*to drivers/staging/media/davinci_vpfe/dm365_resizer.c:945:27: got void *<noident> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: davinci_vpfe: cleanup ipipe_[g|s]_config logicMauro Carvalho Chehab1-54/+56
Reduce one ident level inside those functions and use BIT() macro. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: davinci_vpfe: fix a typo for "default"Mauro Carvalho Chehab1-2/+2
resizer_set_defualt_configuration -> resizer_set_default_configuration Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: davinci_vpfe: don't use kernel-doc markup for simple commentsMauro Carvalho Chehab1-1/+1
Fix those two warnings: drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c:90: warning: Function parameter or member 'interface' not described in 'MODULE_PARM_DESC' drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c:90: warning: Function parameter or member '(default' not described in 'MODULE_PARM_DESC' Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: davinci_vpfe: vpfe_video: remove an unused varMauro Carvalho Chehab1-3/+1
as warned: drivers/staging/media/davinci_vpfe/vpfe_video.c: In function 'vpfe_streamon': drivers/staging/media/davinci_vpfe/vpfe_video.c:1471:31: warning: variable 'sdinfo' set but not used [-Wunused-but-set-variable] struct vpfe_ext_subdev_info *sdinfo; ^~~~~~ While here, cleanup this kernel-doc warning: drivers/staging/media/davinci_vpfe/vpfe_video.c:225: warning: Function parameter or member 'pipe' not described in 'vpfe_video_validate_pipeline' Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: davinci_vpfe: get rid of an unused var at dm365_isif.cMauro Carvalho Chehab1-7/+2
Not sure what was the original idea here, but the implementation went into a different way, and the fmt var is not used anymore, as warned: drivers/staging/media/davinci_vpfe/dm365_isif.c: In function '__isif_get_format': drivers/staging/media/davinci_vpfe/dm365_isif.c:1401:29: warning: variable 'fmt' set but not used [-Wunused-but-set-variable] struct v4l2_subdev_format fmt; ^~~ Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: davinci_vpfe: mark __iomem as suchMauro Carvalho Chehab1-6/+6
There are several usages of an __iomem memory that aren't marked as such, causing those warnings: drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: warning: incorrect type in argument 2 (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: expected void volatile [noderef] <asn:2>*addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: got void * drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:201:27: warning: incorrect type in assignment (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:201:27: expected void *ipipeif_base_addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:201:27: got void [noderef] <asn:2>*ipipeif_base_addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: warning: incorrect type in argument 2 (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: expected void volatile [noderef] <asn:2>*addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: got void * drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: warning: incorrect type in argument 2 (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: expected void volatile [noderef] <asn:2>*addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: got void * drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: warning: incorrect type in argument 2 (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: expected void volatile [noderef] <asn:2>*addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: got void * drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: warning: incorrect type in argument 2 (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: expected void volatile [noderef] <asn:2>*addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: got void * drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: warning: incorrect type in argument 2 (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: expected void volatile [noderef] <asn:2>*addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: got void * drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: warning: incorrect type in argument 2 (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: expected void volatile [noderef] <asn:2>*addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: got void * drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: warning: incorrect type in argument 2 (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: expected void volatile [noderef] <asn:2>*addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: got void * drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: warning: incorrect type in argument 2 (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: expected void volatile [noderef] <asn:2>*addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: got void * drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: warning: incorrect type in argument 2 (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: expected void volatile [noderef] <asn:2>*addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: got void * drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: warning: incorrect type in argument 2 (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: expected void volatile [noderef] <asn:2>*addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: got void * drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: warning: incorrect type in argument 2 (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: expected void volatile [noderef] <asn:2>*addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: got void * drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:71:27: warning: incorrect type in argument 1 (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:71:27: expected void const volatile [noderef] <asn:2>*addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:71:27: got void * drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: warning: incorrect type in argument 2 (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: expected void volatile [noderef] <asn:2>*addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: got void * drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: warning: incorrect type in argument 2 (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: expected void volatile [noderef] <asn:2>*addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: got void * drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:71:27: warning: incorrect type in argument 1 (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:71:27: expected void const volatile [noderef] <asn:2>*addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:71:27: got void * drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: warning: incorrect type in argument 2 (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: expected void volatile [noderef] <asn:2>*addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: got void * drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: warning: incorrect type in argument 2 (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: expected void volatile [noderef] <asn:2>*addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: got void * drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: warning: incorrect type in argument 2 (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: expected void volatile [noderef] <asn:2>*addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: got void * drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: warning: incorrect type in argument 2 (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: expected void volatile [noderef] <asn:2>*addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: got void * drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: warning: incorrect type in argument 2 (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: expected void volatile [noderef] <asn:2>*addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: got void * drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:510:42: warning: incorrect type in initializer (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:510:42: expected void *ipipeif_base_addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:510:42: got void [noderef] <asn:2>*ipipeif_base_addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:71:27: warning: incorrect type in argument 1 (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:71:27: expected void const volatile [noderef] <asn:2>*addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:71:27: got void * drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: warning: incorrect type in argument 2 (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: expected void volatile [noderef] <asn:2>*addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: got void * drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:797:42: warning: incorrect type in initializer (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:797:42: expected void *ipipeif_base_addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:797:42: got void [noderef] <asn:2>*ipipeif_base_addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: warning: incorrect type in argument 2 (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: expected void volatile [noderef] <asn:2>*addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: got void * drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: warning: incorrect type in argument 2 (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: expected void volatile [noderef] <asn:2>*addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: got void * drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: warning: incorrect type in argument 2 (different address spaces) drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: expected void volatile [noderef] <asn:2>*addr drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:76:26: got void * Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: davinci_vpfe: fix vpfe_ipipe_init() error handlingMauro Carvalho Chehab1-8/+8
As warned: drivers/staging/media/davinci_vpfe/dm365_ipipe.c:1834 vpfe_ipipe_init() error: we previously assumed 'res' could be null (see line 1797) There's something wrong at vpfe_ipipe_init(): 1) it caches the resourse_size() from from the first region and reuses to the second region; 2) the "res" var is overridden 3 times; 3) at free logic, it assumes that "res->start" is not overridden by platform_get_resource(pdev, IORESOURCE_MEM, 6), but that's not true, as it can even be NULL there. This patch fixes the above issues by: a) store the resources used by release_mem_region() on a separate var; b) stop caching resource_size(), using the function where needed. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: dm365_ipipe: remove an unused varMauro Carvalho Chehab1-2/+0
drivers/staging/media/davinci_vpfe/dm365_ipipe.c:74:17: warning: variable 'dev' set but not used [-Wunused-but-set-variable] struct device *dev; ^~~ Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-17media: davinci_vpfe: remove useless checks from ipipeMauro Carvalho Chehab2-30/+7
The dm365_ipipe_hw.c and dm365_ipipe.c file check if several table pointers, declared at davinci_vpfe_user.h, are filled before using them. The problem is that those pointers come from struct declarations like: struct vpfe_ipipe_yee { ... short table[VPFE_IPIPE_MAX_SIZE_YEE_LUT]; }; So, they can't be NULL! Solve those warnings: drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c:433 ipipe_set_lutdpc_regs() warn: this array is probably non-NULL. 'dpc->table' drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c:763 ipipe_set_gamma_regs() warn: this array is probably non-NULL. 'gamma->table_r' drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c:766 ipipe_set_gamma_regs() warn: this array is probably non-NULL. 'gamma->table_b' drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c:769 ipipe_set_gamma_regs() warn: this array is probably non-NULL. 'gamma->table_g' drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c:791 ipipe_set_3d_lut_regs() warn: this array is probably non-NULL. 'lut_3d->table' drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c:903 ipipe_set_gbce_regs() warn: this array is probably non-NULL. 'gbce->table' drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c:946 ipipe_set_ee_regs() warn: this array is probably non-NULL. 'ee->table' drivers/staging/media/davinci_vpfe/dm365_ipipe.c:59 ipipe_validate_lutdpc_params() warn: this array is probably non-NULL. 'lutdpc->table' drivers/staging/media/davinci_vpfe/dm365_ipipe.c:697 ipipe_get_gamma_params() warn: this array is probably non-NULL. 'gamma_param->table_r' drivers/staging/media/davinci_vpfe/dm365_ipipe.c:705 ipipe_get_gamma_params() warn: this array is probably non-NULL. 'gamma_param->table_g' drivers/staging/media/davinci_vpfe/dm365_ipipe.c:712 ipipe_get_gamma_params() warn: this array is probably non-NULL. 'gamma_param->table_b' drivers/staging/media/davinci_vpfe/dm365_ipipe.c:745 ipipe_get_3d_lut_params() warn: this array is probably non-NULL. 'lut_param->table' drivers/staging/media/davinci_vpfe/dm365_ipipe.c:926 ipipe_get_gbce_params() warn: this array is probably non-NULL. 'gbce_param->table' Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>