diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2014-04-17 03:17:08 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-04-23 10:13:57 -0300 |
commit | ce9c22443e77594531be84ba8d523f4148ba09fe (patch) | |
tree | ac42be14da6ee7023cec9eef5fd7a7c5e774c889 /drivers/media/v4l2-core | |
parent | 348a634de2407aab8cc9c14a98d8c74aea075bb3 (diff) | |
download | op-kernel-dev-ce9c22443e77594531be84ba8d523f4148ba09fe.zip op-kernel-dev-ce9c22443e77594531be84ba8d523f4148ba09fe.tar.gz |
[media] vb2: fix compiler warning
When compiling this for older kernels using the compatibility build
the compiler complains about uninitialized variables:
In file included from include/linux/kernel.h:20:0,
from include/linux/cache.h:4,
from include/linux/time.h:7,
from include/linux/input.h:13,
from /home/hans/work/build/media_build/v4l/compat.h:9,
from <command-line>:0:
/home/hans/work/build/media_build/v4l/videobuf2-core.c: In function 'vb2_mmap':
include/linux/dynamic_debug.h:60:9: warning: 'plane' may be used uninitialized in this function [-Wmaybe-uninitialized]
printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \
^
/home/hans/work/build/media_build/v4l/videobuf2-core.c:2381:23: note: 'plane' was declared here
unsigned int buffer, plane;
^
In file included from include/linux/kernel.h:20:0,
from include/linux/cache.h:4,
from include/linux/time.h:7,
from include/linux/input.h:13,
from /home/hans/work/build/media_build/v4l/compat.h:9,
from <command-line>:0:
include/linux/dynamic_debug.h:60:9: warning: 'buffer' may be used uninitialized in this function [-Wmaybe-uninitialized]
printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \
^
/home/hans/work/build/media_build/v4l/videobuf2-core.c:2381:15: note: 'buffer' was declared here
unsigned int buffer, plane;
^
While these warnings are bogus (the call to __find_plane_by_offset will
set buffer and plane), it doesn't hurt to initialize these variables.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/v4l2-core')
-rw-r--r-- | drivers/media/v4l2-core/videobuf2-core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c index f8f694a..40024d7 100644 --- a/drivers/media/v4l2-core/videobuf2-core.c +++ b/drivers/media/v4l2-core/videobuf2-core.c @@ -2378,7 +2378,7 @@ int vb2_mmap(struct vb2_queue *q, struct vm_area_struct *vma) { unsigned long off = vma->vm_pgoff << PAGE_SHIFT; struct vb2_buffer *vb; - unsigned int buffer, plane; + unsigned int buffer = 0, plane = 0; int ret; unsigned long length; |