From patchwork Mon Aug 13 21:32:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 144046 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3550401ljj; Mon, 13 Aug 2018 14:32:43 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxouerY3hPIsmx2q1VyaEFfKpEFr8lXyV5iUfm5e/Zr3hlLVUyoWOoxIqmsjaQC/SVCiZOn X-Received: by 2002:a17:902:704c:: with SMTP id h12-v6mr17837331plt.237.1534195963085; Mon, 13 Aug 2018 14:32:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534195963; cv=none; d=google.com; s=arc-20160816; b=iIKH5AD/XZ2X91viXPF0N0mFJXvQJxlbHzmbPejWZa8Ets61oPlXQaHdq3WZRF3V6k 1VM44cnUbYBpspF1orjrJNgZTCpawpT5GQ1mMLDAWedQn2FmSrFiHSF4KxLQZVUTU7Nj NDHuNx9PQU7LiTZw/hpiEjvnmakeVbf5n0Y3cVszM8eGqeqpz2KWWNR448DzlNdk2BNY zYlBuSZ9KQ7CNUpL+Bs/IQPCz9YDShY2xWkni1P2jXVeKJ//6lcKfYe9TeJj5qcTjT8d rC3DFhHCGwK7FBgBAPnJGPGc5U4j26FJJe86ws0SoxPXfns3eP4sb/gKBVa8NI05Bvjj sKFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=JhlokgQRCRTVsuL7gFBJB1SiCN/6Wdo0HV9m11JJd5w=; b=fj90bPEJJIY0jq9FJ9zf3KDi2ePLe0xgE4K9ye59E6RwkrDYSnas2oNH7+9MEIBZta BCcikZ1rjkXb+goufMgDr3oLBIal7ucj7x/eFytrnnoRwZV2MccqpAQKdGyHyOOyeIRy qbo9Rf6brU9MUminTjQ3ucbO2R0J6bMT2PiaIRSGFlYK9/gYroihpvqf1CwEFVGZCoG0 txRzIesilnpIjhuRMKjyf1uTV4DXpgjhm8rAy9lyj/TqDffr61L1RDiI0j24v/Q0Sbbr N+EtdgQIK7msAsYr9Zh6cV/7x0KyU5F6U+gD/HbFL9LcHWW7h4wGqWt6O1Upt7k83Omv PGZg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n88-v6si19504212pfi.360.2018.08.13.14.32.42; Mon, 13 Aug 2018 14:32:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729835AbeHNAQl (ORCPT + 4 others); Mon, 13 Aug 2018 20:16:41 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:58517 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729126AbeHNAQl (ORCPT ); Mon, 13 Aug 2018 20:16:41 -0400 Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0MYvnH-1fKgk12pBD-00VeFa; Mon, 13 Aug 2018 23:32:30 +0200 From: Arnd Bergmann To: Steve Longerbeam , Philipp Zabel , Mauro Carvalho Chehab , Greg Kroah-Hartman Cc: Arnd Bergmann , Hans Verkuil , Peter Seiderer , Jan Luebbe , linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: imx: work around false-positive warning, again Date: Mon, 13 Aug 2018 23:32:17 +0200 Message-Id: <20180813213228.2834099-1-arnd@arndb.de> X-Mailer: git-send-email 2.18.0 X-Provags-ID: V03:K1:huaeqNRn3W3JyedO+eJjI0kMd4s579K3/5w3Ib+7MFNAI9NIEp7 bP22M8bN1KfPzHlpnMbPD7xKzoXyMv8MlnweC0ugcDvgpmEz8lD5qt6ngGXLm7m6+Y44ZuF v6Q0Pt2Ok0u5wSHYMP/nDJ972ZiZ7iVud2X6cjIjIgInIxJZ4VvUBjTGNrWcrchQWg0q2XG t1ZQ11XGD/Z6Sm3+ziZrw== X-UI-Out-Filterresults: notjunk:1; V01:K0:LNVRkhu0OQo=:nsbbcGTO27wXHOZLnl2JIH Fxs135CSA9MCAtvudPhfVYTGXdO43XEs//eqASA4nM/RIT89IjKy4LN7aTArYxDQuDLRaJfUf NdtglAIiOIycomCnnr7AyxEtkEn6J3xvr04JJuFKzynnXSKBSwwF+vegUr3Q2lTUreGbSzb3c M12UMlgD8ttiLlK05Fk0v1xibozqimweXS7lOsHbGfx66fv92jLnDARKIP99pLRq2lDA625wa fzcQlYvCB3P1qdUxkY9OHp03Y2X1iuRhw2SlNelixU0k45vTYEpTS5X3EBQDMm/bvUF/4RFMz g1s6qbKHAnBe1GLRCIB5ONE6jho7TIqxKMeU9qH5yuILiXjOPlwTvnTa1s5IjMWXngY2nimZz dBiV0a/o6EGJnMt/RgfzIpzv5U+AoR7Firq1gVbJMsG5ILmaJooUMtm4b/RsA00ahw3LhPjal 4zcOUlzIw4laHl/0tVHorKtFzGFkdXSRL56QimkoqGH0wOmLrOxUbREg5tOG8h7j3A1JFLU2j sVWbJIBFAvU/+pNyyIy72WdyZfGVKWJ2wbqXQantDPmpEZcRqink90ATPT84uDqIxn6N65SPG KbVPh8tY/W5/ByT1TYBB241fD7lYUdu6H7GaNt7DFYkIX5p9+2HEO8wg2K0dx5Iw19gZBLwV1 l6g+7TwlTof/o/WCoou236FpQvwkXqmFHO5jqOodfdZ9bCwqC0/6NXIRWRisv0Bgw7Hs= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org A warning that I thought to be solved by a previous patch of mine has resurfaced with gcc-8: media/imx/imx-media-csi.c: In function 'csi_link_validate': media/imx/imx-media-csi.c:1025:20: error: 'upstream_ep' may be used uninitialized in this function [-Werror=maybe-uninitialized] media/imx/imx-media-csi.c:1026:24: error: 'upstream_ep.bus_type' may be used uninitialized in this function [-Werror=maybe-uninitialized] 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] media/imx/imx-media-csi.c: In function 'csi_enum_mbus_code': media/imx/imx-media-csi.c:132:9: error: '*((void *)&upstream_ep+12)' may be used uninitialized in this function [-Werror=maybe-uninitialized] media/imx/imx-media-csi.c:132:48: error: 'upstream_ep.bus.parallel.bus_width' may be used uninitialized in this function [-Werror=maybe-uninitialized] I spent some more time digging in this time, and think I have a better fix, bailing out of the function that either initializes or errors out here, which simplifies the code enough for gcc to figure out what is going on. The earlier partial workaround can be removed now, as the new workaround is better. Fixes: 890f27693f2a ("media: imx: work around false-positive warning") Signed-off-by: Arnd Bergmann --- drivers/staging/media/imx/imx-media-csi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.18.0 diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c index cd2c291e1e94..4acdd7ae612b 100644 --- a/drivers/staging/media/imx/imx-media-csi.c +++ b/drivers/staging/media/imx/imx-media-csi.c @@ -165,6 +165,9 @@ static int csi_get_upstream_endpoint(struct csi_priv *priv, struct v4l2_subdev *sd; struct media_pad *pad; + if (!IS_ENABLED(CONFIG_OF)) + return -ENXIO; + if (!priv->src_sd) return -EPIPE; @@ -1050,7 +1053,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; bool is_csi2; int ret;