media: v4l2-fwnode: suppress a warning at OF parsing logic
authorMauro Carvalho Chehab <mchehab@s-opensource.com>
Mon, 26 Jun 2017 18:07:54 +0000 (14:07 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Thu, 20 Jul 2017 20:26:21 +0000 (16:26 -0400)
commit4ee236219f6da367093b503b52fcceb609397c6f
treed7c7b6acba03202f54f9434b827ebcafefcda9df
parent1ad371deb9b0be142dca205611a56854a37fc48d
media: v4l2-fwnode: suppress a warning at OF parsing logic

smatch produce this warning:
drivers/media/v4l2-core/v4l2-fwnode.c:76 v4l2_fwnode_endpoint_parse_csi_bus() error: buffer overflow 'array' 5 <= u16max

That's because, in thesis, the routine might have called with
some value at bus->num_data_lanes. That's not the current
case.

Yet, better to shut up this warning, and make the code more
reliable if some future changes might cause a bug.

While here, simplify the code a little bit by reading only
once from lanes-properties array.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/v4l2-core/v4l2-fwnode.c
include/media/v4l2-fwnode.h