media: imx: work around false-positive warning
authorArnd Bergmann <arnd@arndb.de>
Tue, 13 Mar 2018 13:14:09 +0000 (09:14 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 4 Apr 2018 10:12:52 +0000 (06:12 -0400)
commit890f27693f2a6b9a0a7c13bf931b9d1dde050e04
tree753f290a02025ad12ba1663a2748a915b3e76a71
parent2e81ae396788c7f1af327510899f06f773fe3501
media: imx: work around false-positive warning

The IS_ERR()/PTR_ERR() combination confuses gcc to the point that it
cannot prove the upstream_ep variable to be initialized:

drivers/staging/media/imx/imx-media-csi.c: In function 'csi_link_validate':
drivers/staging/media/imx/imx-media-csi.c:1025:20: error: 'upstream_ep' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  priv->upstream_ep = upstream_ep;
  ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
drivers/staging/media/imx/imx-media-csi.c:1026:24: error: 'upstream_ep.bus_type' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  is_csi2 = (upstream_ep.bus_type == V4L2_MBUS_CSI2);
             ~~~~~~~~~~~^~~~~~~~~
drivers/staging/media/imx/imx-media-csi.c:127:19: error: 'upstream_ep.bus.parallel.bus_width' may be used uninitialized in this function [-Werror=maybe-uninitialized]

I could come up with no good way to rewrite this function, as a last
resort, this adds an explicit zero-intialization of the structure.

Fixes: 52e17089d185 ("media: imx: Don't initialize vars that won't be used")

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>
drivers/staging/media/imx/imx-media-csi.c