]> git.baikalelectronics.ru Git - kernel.git/commit
media: vivid: shut up warnings due to a non-trivial logic
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 7 Aug 2018 11:29:12 +0000 (07:29 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Wed, 8 Aug 2018 14:57:14 +0000 (10:57 -0400)
commite92929c4a7d6197e2dffa6e195b43c021399d344
treee10ad409f67d05d07100718a2f6856d6d8ed888e
parent393b746992d8a6f6f3f95d5d70b000d1173aba6c
media: vivid: shut up warnings due to a non-trivial logic

The vivid driver uses a complex logic to save one kalloc/kfree
allocation. That non-trivial way of allocating data causes
smatch to warn:
drivers/media/platform/vivid/vivid-core.c:869 vivid_create_instance() warn: potentially one past the end of array 'dev->query_dv_timings_qmenu[dev->query_dv_timings_size]'
drivers/media/platform/vivid/vivid-core.c:869 vivid_create_instance() warn: potentially one past the end of array 'dev->query_dv_timings_qmenu[dev->query_dv_timings_size]'

I also needed to read the code several times in order to understand
what it was desired there. It turns that the logic was right,
although confusing to read.

As it is doing allocations on a non-standard way, let's add some
documentation while shutting up the false positive.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/vivid/vivid-core.c