diff options
author | Arnd Bergmann <arnd@arndb.de> | 2018-03-13 09:14:09 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2018-04-04 06:12:52 -0400 |
commit | 890f27693f2a6b9a0a7c13bf931b9d1dde050e04 (patch) | |
tree | 753f290a02025ad12ba1663a2748a915b3e76a71 /drivers | |
parent | 2e81ae396788c7f1af327510899f06f773fe3501 (diff) |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/media/imx/imx-media-csi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c index 1aa2be891704..00c9d625cfb5 100644 --- a/drivers/staging/media/imx/imx-media-csi.c +++ b/drivers/staging/media/imx/imx-media-csi.c @@ -1005,7 +1005,7 @@ static int csi_link_validate(struct v4l2_subdev *sd, struct v4l2_subdev_format *sink_fmt) { struct csi_priv *priv = v4l2_get_subdevdata(sd); - struct v4l2_fwnode_endpoint upstream_ep; + struct v4l2_fwnode_endpoint upstream_ep = {}; const struct imx_media_pixfmt *incc; bool is_csi2; int ret; |