Ulf Hansson [Wed, 9 Nov 2016 14:23:52 +0000 (12:23 -0200)]
[media] exynos-gsc: Make driver functional when CONFIG_PM is unset
The driver depended on CONFIG_PM to be functional. Let's remove that
dependency, by enable the runtime PM resourses during ->probe() and
update the device's runtime PM status to reflect this.
[media] exynos-gsc: unregister video device node on driver removal
The driver doesn't unregister the video device node when the driver is
removed, this keeps video device nodes that makes the machine to crash
with a NULL pointer dereference when nodes are attempted to be opened:
[ 36.530006] Unable to handle kernel paging request at virtual address bf1f8200
[ 36.535985] pgd = edbbc000
[ 36.538486] [bf1f8200] *pgd=6d99a811, *pte=00000000, *ppte=00000000
[ 36.544727] Internal error: Oops: 7 [#1] PREEMPT SMP ARM
[ 36.550016] Modules linked in: s5p_jpeg s5p_mfc v4l2_mem2mem videobuf2_dma_contig
[ 36.566303] CPU: 6 PID: 533 Comm: v4l2-ctl Not tainted 4.8.0
[ 36.574466] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
[ 36.580526] task: ee3cc600 task.stack: ed626000
[ 36.585046] PC is at try_module_get+0x1c/0xac
[ 36.589364] LR is at try_module_get+0x1c/0xac
[ 36.593698] pc : [<c0187a60>] lr : [<c0187a60>] psr: 80070013
[ 36.593698] sp : ed627de0 ip : a0070013 fp : 00000000
[ 36.605156] r10: 00000002 r9 : ed627ed0 r8 : 00000000
[ 36.610331] r7 : c01e5f14 r6 : ed57be00 r5 : bf1f8200 r4 : bf1f8200
[ 36.616834] r3 : 00000002 r2 : 00000002 r1 : 01930192 r0 : 00000001
..
[ 36.785004] [<c0187a60>] (try_module_get) from [<c01e5c10>] (cdev_get+0x1c/0x4c)
[ 36.792362] [<c01e5c10>] (cdev_get) from [<c01e5f40>] (chrdev_open+0x2c/0x178)
[ 36.799555] [<c01e5f40>] (chrdev_open) from [<c01df5d4>] (do_dentry_open+0x1e0/0x300)
[ 36.807360] [<c01df5d4>] (do_dentry_open) from [<c01eecdc>] (path_openat+0x35c/0xf58)
[ 36.815154] [<c01eecdc>] (path_openat) from [<c01f0668>] (do_filp_open+0x5c/0xc0)
[ 36.822606] [<c01f0668>] (do_filp_open) from [<c01e09ac>] (do_sys_open+0x10c/0x1bc)
[ 36.830235] [<c01e09ac>] (do_sys_open) from [<c01078c0>] (ret_fast_syscall+0x0/0x3c)
[ 36.837942] Code: 0a00001ce1a04000e3a00001ebfec92d (e5943000)
[media] exynos-gsc: don't release a non-dynamically allocated video_device
The struct v4l2_device instance for the G-Scaler is not dyanmically
allocated but a member of the struct gsc_dev. In fact, the assigned
.release callback is video_device_release_empty().
But gsc_register_m2m_device() attempts to release the v4l2_device by
calling video_device_release() in its error path. This is wrong since
the v4l2_device wasn't allocated directly and will be freed once its
parent struct gsc_dev is freed.
While being there, rename the remaining goto label in the error path
to something that better explains the error path cleanup.
[media] exynos-gsc: do proper bytesperline and sizeimage calculation
The driver don't take into account the differences between packed, semi
planar and multi planar formats when calculating the pixel format bytes
per lines and image size values. This makes GStreamer to fail when the
following formats are used NV12, NV21, NV16, NV61, YV12, I420 and Y42B:
"gst_video_frame_map_id: failed to map video frame plane 1"
Nicolas suggested to use the logic found in the Exynos FIMC v4l2 driver
since does this correctly. So this patch changes the bytes per line and
image size calculation according to what's done in this media driver.
After this patch most supported formats work correctly. There are still
issues with the NV21 and NV61 formats, but that seems to be a separate
problem since NV12 and NV16 work and these formats use the same values.
So this can be fixed as a follow-up and shouldn't be a blocker for this
change that improves the driver's support.
Suggested-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
[media] exynos-gsc: fix supported RGB pixel format
The driver exposes 32-bit A/XRGB 8-8-8-8 as supported format but testing
shows that using this format produces frames with wrong colors. The test
was done with the following GStreamer pipeline:
The manual seems to state that the Pixel Format are in Little Endianness
so instead use the 32-bit BGRA/X 8-8-8-8 pixel format. This format works
correctly when using the following pipeline:
[media] exynos-gsc: don't clear format when freeing buffers with REQBUFS(0)
User-space applications can use the VIDIOC_REQBUFS ioctl to determine if a
memory mapped, user pointer or DMABUF based I/O is supported by a driver.
For example, GStreamer attempts to determine the I/O methods supported by
the driver by doing many VIDIOC_REQBUFS ioctl calls with different memory
types and count 0. And then the real VIDIOC_REQBUFS call with count == n
is be made to allocate the buffers. But for count 0, the driver not only
frees the buffers but also clears the format set before with VIDIOC_S_FMT.
This is a problem since STREAMON fails if a format isn't set but GStreamer
first sets a format and then tries to determine the supported I/O methods,
so the format will be cleared on REQBUFS(0), before the call to STREAMON.
To avoid this issue, only free the buffers on VIDIOC_REQBUFS(0) but don't
clear the format. Since is completely valid to set the format and then do
different calls to REQBUFS before a call to STREAMON.
[media] exynos-gsc: change spamming try_fmt log message to debug
The driver try_fmt handler prints a message each time that the image
size has been changed due the maximum and minimum width and height.
Since user-space can try different format and sizes, this logs a lot
of unnecessary messages. Change the message log level to debug and
while being there, also add a new line to the message.
Nicolas Dufresne [Wed, 26 Mar 2014 22:48:39 +0000 (19:48 -0300)]
[media] exynos4-is: fimc: Roundup imagesize to row size for tiled formats
For tiled format, we need to allocated a multiple of the row size. A
good example is for 1280x720, wich get adjusted to 1280x736. In tiles,
this mean Y plane is 20x23 and UV plane 20x12. Because of the rounding,
the previous code would only have enough space to fit half of the last
row.
The FDP1 is a de-interlacing module which converts interlaced video to
progressive video. It is also capable of performing pixel format conversion
between YCbCr/YUV formats and RGB formats.
Peter Ujfalusi [Fri, 4 Nov 2016 07:58:02 +0000 (05:58 -0200)]
[media] v4l: omap3isp: Use dma_request_chan_by_mask() to request the DMA channel
When requesting the DMA channel it was mandatory that we do not have DMA
resource nor valid DMA channel via DT. In this case the
dma_request_slave_channel_compat() would fall back and request any channel
with SW trigger.
The same can be achieved with the dma_request_chan_by_mask() without the
misleading use of the DMAengine API - implying that the omap3isp does
need to have DMA resource or valid dma binding in DT.
[media] v4l: omap3isp: Fix OF node double put when parsing OF graph
When parsing the graph the driver loops over all endpoints using
of_graph_get_next_endpoint(). The function handles reference counting of
the passed and returned nodes, so the returned node's reference count
must not be decreased manually in the normal path.
Move the offending of_node_put() call to the error path that requires
manual reference count handling.
Philipp Zabel [Mon, 7 Nov 2016 20:15:47 +0000 (18:15 -0200)]
[media] uvcvideo: add support for Oculus Rift Sensor
The Rift CV1 Sensor has bInterfaceClass set to vendor specific, so we
need an entry in uvc_ids to probe it. Just as the Rift DK2 IR tracker,
it misreports the pixel format as YUYV instead of Y8.
The sensor is configured with a low exposure time and high black level
by default, so that only bright IR sources can be seen.
The CEC_LOG_ADDRS_FL_CDC_ONLY flag is missing at the documentation,
causing this warning:
Documentation/output/cec.h.rst:6: WARNING: undefined label: cec-log-addrs-fl-cdc-only (if the link has no caption the label must precede a section header)
Add a documentation for it, based on the commit that introduced the
flag.
Fixes: a69a168a1bd4 ("[media] cec: add proper support for CDC-Only CEC devices") Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Wed, 9 Nov 2016 14:10:59 +0000 (12:10 -0200)]
[media] cec: zero counters in cec_received_msg()
Make sure the TX counters are zeroed in the cec_msg struct.
Non-zero TX counters make no sense when a message is received,
and applications should not see non-zero values here.
Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Wed, 2 Nov 2016 10:37:15 +0000 (08:37 -0200)]
[media] s5p-cec/st-cec: update TODOs
Update the TODOs explaining why these two drivers remain in
staging. The reason is that these drivers rely on userspace to
set the physical address, but that should come from the HDMI
output driver. This in turn needs the upcoming HDMI notifier
framework.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Wed, 2 Nov 2016 10:25:28 +0000 (08:25 -0200)]
[media] cec: move the CEC framework out of staging and to media
The last open issues have been addressed, so it is time to move
this out of staging and into the mainline and to move the public
cec headers to include/uapi/linux.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Wed, 2 Nov 2016 09:41:41 +0000 (07:41 -0200)]
[media] cec: add proper support for CDC-Only CEC devices
CDC-Only CEC devices are CEC devices that can only handle CDC messages,
all other messages are ignored.
Add a flag to signal that this is a CDC-Only device and act accordingly.
Also add helper functions to identify if a CEC device is configured as a
CDC-Only device, a second TV, a switch or a processor, since these variations
cannot be determined by the logical address alone.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Tue, 1 Nov 2016 13:07:17 +0000 (11:07 -0200)]
[media] cec: accept two replies for CEC_MSG_INITIATE_ARC
The CEC_MSG_INITIATE_ARC message is special since it is the ONLY
CEC message that accepts two possible valid replies:
CEC_MSG_REPORT_ARC_INITIATED and CEC_MSG_REPORT_ARC_TERMINATED.
So if the transmitted message is CEC_MSG_INITIATE_ARC and the remote
side replied with CEC_MSG_REPORT_ARC_INITIATED or CEC_MSG_REPORT_ARC_TERMINATED,
then a msg->reply value of CEC_MSG_REPORT_ARC_INITIATED or
CEC_MSG_REPORT_ARC_TERMINATED will match either reply.
I thought about either adding a second reply2 field, but that's ugly
for all other messages that have only one reply, and what if in the
future a new message is added that can have three replies?
Another option would be to add a cec_msg flag, but really, the combination
of CEC_MSG_REPORT_ARC_INITIATED and a reply value of one of the two
possible replies already functions as a flag.
Another advantage of this approach is that it is safe to re-use a
cec_msg struct. No need to zero a flags field or a reply2 field.
So since this really is an exception in the CEC specification, I
decided to implement it as an exception as well.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Tue, 1 Nov 2016 12:48:22 +0000 (10:48 -0200)]
[media] cec: filter invalid messages
As per the CEC specification:
- CEC messages with a too-small payload should be ignored.
- Broadcast messages that are only allowed as directed messages
should be ignored.
- Directed messages that are only allowed as broadcast messages
should be ignored.
Implement this in the core CEC framework.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Tue, 1 Nov 2016 10:55:05 +0000 (08:55 -0200)]
[media] cec: add CEC_MSG_FL_REPLY_TO_FOLLOWERS
Give the caller more control over how replies to a transmit are
handled. By default the reply will only go to the filehandle that
called CEC_TRANSMIT. If this new flag is set, then the reply will
also go to all followers.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Tue, 1 Nov 2016 09:59:34 +0000 (07:59 -0200)]
[media] cec: add flag to cec_log_addrs to enable RC passthrough
By default the CEC_MSG_USER_CONTROL_PRESSED/RELEASED messages
are passed on to the follower(s) only. If the new
CEC_LOG_ADDRS_FL_ALLOW_RC_PASSTHRU flag is set in the
flags field of struct cec_log_addrs then these messages are also
passed on to the remote control input subsystem and they will appear
as keystrokes.
This used to be the default behavior, but now you have to explicitly
enable it. This is done to force the caller to think about possible
security issues (e.g. if these messages are used to enter passwords).
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Wed, 9 Nov 2016 08:00:53 +0000 (06:00 -0200)]
[media] cec-core.rst: improve documentation
Improve the internal CEC documentation. In particular add a section
that specifies that transmit-related interrupts should be processed
before receive interrupts.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Markus Elfring [Sun, 6 Nov 2016 19:40:20 +0000 (17:40 -0200)]
[media] DaVinci-VPBE: Check return value of a setup_if_config() call in vpbe_set_output()
* A function was called over the pointer "setup_if_config" in the data
structure "venc_platform_data". But the return value was not used so far.
Thus assign it to the local variable "ret" which will be checked with
the next statement.
Fixes: 9a7f95ad1c946efdd7a7a72df27db738260a0fd8 ("[media] davinci vpbe: add dm365 VPBE display driver changes")
* Pass a value to this function call without storing it in an intermediate
variable before.
* Delete the local variable "if_params" which became unnecessary with
this refactoring.
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Thu, 14 Jul 2016 14:53:47 +0000 (11:53 -0300)]
[media] adv7604: add vic detect
Obtain the correct timings based on the VIC code from the AVI InfoFrame.
It does a sanity check to see if at least the measured width and height
are in line with what the VIC code reports. If not, then use the timings
instead of the VIC code (as per the CEA-861 spec).
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Thu, 14 Jul 2016 10:59:12 +0000 (07:59 -0300)]
[media] v4l2-dv-timings: add helpers for vic and pixelaspect ratio
Add a helper to find timings based on the CEA-861 VIC code. Also,
add a helper that returns the pixel aspect ratio based on the
v4l2_dv_timings struct.
Hans Verkuil [Thu, 14 Jul 2016 10:58:35 +0000 (07:58 -0300)]
[media] videodev2.h: add VICs and picture aspect ratio
Add picture aspect ratio information, the CEA-861 VIC (Video Identification
Code) and the HDMI VIC to struct v4l2_bt_timings.
The picture aspect was chosen rather than the pixel aspect since 1) the
CEA-861 standard uses picture aspect, and 2) pixel aspect ratio can become
tricky when dealing with pixel repeat timings. While we don't support those
yet at the moment, this might become necessary. And in that case using
picture aspect ratio makes more sense. And converting picture aspect ratio
to pixel aspect ratio is easy enough.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Jonathan Sims [Sun, 23 Oct 2016 18:19:07 +0000 (16:19 -0200)]
[media] hdpvr: fix interrupted recording
This is a reworking of a patch originally submitted by Ryley Angus,
modified by Hans Verkuil and then seemingly forgotten before changes
suggested by Keith Pyle here:
I have implemented the suggested changes and have been testing for the
last 2 months. I am no longer experiencing lockups while recording
(with blue light on, requiring power cycling) which had been a long
standing problem with the HD-PVR. I have not noticed any other problems
since applying the patch.
Signed-off-by: Jonathan Sims <jonathan.625266@earthlink.net> Reported-by: Ryley Angus <ryleyjangus@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Sakari Ailus [Tue, 18 Oct 2016 13:15:32 +0000 (11:15 -0200)]
[media] v4l: Document that m2m devices have a file handle specific context
Memory-to-memory V4L2 devices all have file handle specific context.
Say this in the API documentation so that the user space may rely on it
being the case.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Colin Ian King [Mon, 19 Sep 2016 06:19:28 +0000 (03:19 -0300)]
[media] st-hva: fix a copy-and-paste variable name error
The second check for an error on hva->lmi_err_reg appears
to be a copy-and-paste error, it should be hva->emi_err_reg
instead.
Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Jean-Christophe Trotin <jean-christophe.trotin@st.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Andrey Utkin [Sat, 22 Oct 2016 15:34:36 +0000 (13:34 -0200)]
[media] media: solo6x10: fix lockup by avoiding delayed register write
This fixes a lockup at device probing which happens on some solo6010
hardware samples. This is a regression introduced by commit e1ceb25a1569
("[media] SOLO6x10: remove unneeded register locking and barriers")
The observed lockup happens in solo_set_motion_threshold() called from
solo_motion_config().
This extra "flushing" is not fundamentally needed for every write, but
apparently the code in driver assumes such behaviour at last in some
places.
Actual fix was proposed by Hans Verkuil.
Fixes: e1ceb25a1569 ("[media] SOLO6x10: remove unneeded register locking and barriers") Cc: stable@vger.kernel.org # 4.3 and up Signed-off-by: Andrey Utkin <andrey.utkin@corp.bluecherry.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.
Export the module alias information using the MODULE_DEVICE_TABLE() macro.
Before this patch:
$ modinfo drivers/staging/media//st-cec/stih-cec.ko | grep alias
$
After this patch:
$ modinfo drivers/staging/media//st-cec/stih-cec.ko | grep alias
alias: of:N*T*Cst,stih-cecC*
alias: of:N*T*Cst,stih-cec
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.
Export the module alias information using the MODULE_DEVICE_TABLE() macro.
Before this patch:
$ modinfo drivers/staging/media/s5p-cec/s5p-cec.ko | grep alias
$
After this patch:
$ modinfo drivers/staging/media/s5p-cec/s5p-cec.ko | grep alias
alias: of:N*T*Csamsung,s5p-cecC*
alias: of:N*T*Csamsung,s5p-cec
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.
Export the module alias information using the MODULE_DEVICE_TABLE() macro.
Before this patch:
$ modinfo drivers/media/rc/meson-ir.ko | grep alias
$
[media] v4l: rcar-fcp: Fix module autoload for OF registration
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.
Export the module alias information using the MODULE_DEVICE_TABLE() macro.
Before this patch:
$ modinfo drivers/media/platform/rcar-fcp.ko | grep alias
alias: rcar-fcp
[media] v4l: vsp1: Fix module autoload for OF registration
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.
Export the module alias information using the MODULE_DEVICE_TABLE() macro.
Before this patch:
$ modinfo drivers/media/platform/vsp1/vsp1.ko | grep alias
alias: vsp1
As reported by smatch:
drivers/media/usb/usbtv/usbtv-video.c:716 usbtv_s_ctrl() error: doing dma on the stack (data)
drivers/media/usb/usbtv/usbtv-video.c:758 usbtv_s_ctrl() error: doing dma on the stack (data)
We should not do it, as it won't work on Kernels 4.9 and upper.
So, alloc a buffer for it.
Dan Carpenter [Fri, 14 Oct 2016 07:32:24 +0000 (04:32 -0300)]
[media] st-hva: fix some error handling in hva_hw_probe()
The devm_ioremap_resource() returns error pointers, never NULL. The
platform_get_resource() returns NULL on error, never error pointers.
The error code needs to be set, as well. The current code returns
PTR_ERR(NULL) which is success.
Fixes: 57b2c0628b60 ("[media] st-hva: multi-format video encoder V4L2 driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Jean-Christophe Trotin <jean-christophe.trotin@st.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Arnd Bergmann [Thu, 13 Oct 2016 14:39:04 +0000 (11:39 -0300)]
[media] s5p-cec: mark PM functions as __maybe_unused again
A bugfix removed the two callers of s5p_cec_runtime_suspend
and s5p_cec_runtime_resume, leading to the return of a harmless
warning that I had previously fixed in commit aee8937089b1
("[media] s5p_cec: mark suspend/resume as __maybe_unused"):
staging/media/s5p-cec/s5p_cec.c:234:12: error: ‘s5p_cec_runtime_suspend’ defined but not used [-Werror=unused-function]
staging/media/s5p-cec/s5p_cec.c:242:12: error: ‘s5p_cec_runtime_resume’ defined but not used [-Werror=unused-function]
This adds the __maybe_unused annotations to the function that
were not removed and that are now unused when CONFIG_PM
is disabled.
Fixes: 57b978ada073 ("[media] s5p-cec: fix system and runtime PM integration") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Markus Elfring [Wed, 12 Oct 2016 13:30:44 +0000 (10:30 -0300)]
[media] DaVinci-VPIF-Display: Use kcalloc() in vpif_probe()
* A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus use the corresponding function "kcalloc".
This issue was detected by using the Coccinelle software.
* Replace the specification of a data type by a pointer dereference
to make the corresponding size determination a bit safer according to
the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Markus Elfring [Wed, 12 Oct 2016 13:15:34 +0000 (10:15 -0300)]
[media] DaVinci-VPIF-Capture: Use kcalloc() in vpif_probe()
* A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus use the corresponding function "kcalloc".
This issue was detected by using the Coccinelle software.
* Replace the specification of a data type by a pointer dereference
to make the corresponding size determination a bit safer according to
the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Markus Elfring [Wed, 12 Oct 2016 09:22:23 +0000 (06:22 -0300)]
[media] DaVinci-VPFE-Capture: Move two assignments in vpfe_s_input()
Move assignments for two local variables into an else branch so that
their setting will only be performed after corresponding data processing
succeeded by this function.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Markus Elfring [Wed, 12 Oct 2016 08:44:05 +0000 (05:44 -0300)]
[media] DaVinci-VPFE-Capture: Improve another size determination in vpfe_open()
Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Markus Elfring [Wed, 12 Oct 2016 08:24:57 +0000 (05:24 -0300)]
[media] DaVinci-VPFE-Capture: Improve another size determination in vpfe_probe()
Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Markus Elfring [Wed, 12 Oct 2016 08:20:02 +0000 (05:20 -0300)]
[media] DaVinci-VPFE-Capture: Use kmalloc_array() in vpfe_probe()
* A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus use the corresponding function "kmalloc_array".
This issue was detected by using the Coccinelle software.
* Replace the specification of a data type by a pointer dereference
to make the corresponding size determination a bit safer according to
the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Markus Elfring [Tue, 11 Oct 2016 07:40:41 +0000 (04:40 -0300)]
[media] DaVinci-VPBE: Use kmalloc_array() in vpbe_initialize()
* A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus use the corresponding function "kmalloc_array".
This issue was detected by using the Coccinelle software.
* Replace the specification of a data type by a pointer dereference
to make the corresponding size determination a bit safer according to
the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Markus Elfring [Sun, 9 Oct 2016 19:12:13 +0000 (16:12 -0300)]
[media] blackfin-capture: Use kcalloc() in bcap_init_sensor_formats()
A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus reuse the corresponding function "kcalloc".
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Markus Elfring [Fri, 7 Oct 2016 20:07:27 +0000 (17:07 -0300)]
[media] cx88-dsp: Use kmalloc_array() in read_rds_samples()
* A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus use the corresponding function "kmalloc_array".
This issue was detected by using the Coccinelle software.
* Replace the specification of a data type by a pointer dereference
to make the corresponding size determination a bit safer according to
the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>