From patchwork Tue Mar 13 13:14:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10278677 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 938D760231 for ; Tue, 13 Mar 2018 13:14:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 853722861C for ; Tue, 13 Mar 2018 13:14:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 79AD4287F0; Tue, 13 Mar 2018 13:14:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 100FF2861C for ; Tue, 13 Mar 2018 13:14:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752009AbeCMNOg (ORCPT ); Tue, 13 Mar 2018 09:14:36 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:54783 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751852AbeCMNOe (ORCPT ); Tue, 13 Mar 2018 09:14:34 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue004 [212.227.15.129]) with ESMTPA (Nemesis) id 0MLTGA-1evBWk2A7u-000eAv; Tue, 13 Mar 2018 14:14:24 +0100 From: Arnd Bergmann To: Steve Longerbeam , Philipp Zabel , Mauro Carvalho Chehab , Greg Kroah-Hartman Cc: Arnd Bergmann , Hans Verkuil , Russell King , linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: imx: work around false-positive warning Date: Tue, 13 Mar 2018 14:14:09 +0100 Message-Id: <20180313131422.40710-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:lwgeH8CYbjofM9DV/o1EmbQj3gPLA75y4SaqkfjMdCulfsc/oZj lE1xNKLLgvJOhsb2IemsGnyMw/9a+5p6hK/fhYdHo5EYvakoVf5VdVJpADXFeMXMuMhvUnt t2mP076VIzvkn9KTw8gFi8WgW65IEm8BLDcQwRiralJGV3jPE2yFVzMY+9niy62jxRqb2hU xRd7/Q8YwzLTxBbS7ReiA== X-UI-Out-Filterresults: notjunk:1; V01:K0:BjZm+/uAie8=:dl9ltLvt+GRUXrSO/CkcnV 8VHrlRSnm5tVZt4ODuV7MOIx8nyGcH8QuQlhWPV+p2BcsO1k6s50en5XdzcJy/ZS/GkqX/YwT 9GJZjtn2IJAtZQE+Pk5VhJFkD62Xg+P4IFwOQ3HdXeoHK85aG91mQhR0wwsGx96k5d696qi6n 7jaeA9kIbG4mdOOaAP6toKkVnDNWPQTQGd+1iiSgFzI25ty8qicmG4KtR48Vuvef7Hhiz3BE4 /UlSgM4Y2XgWURJGW0FXaqBztmdI/4WsDW9ukpryGrgaOI6dAvZTV4y7FWuGQXyduvPIlZ17j 7dbYk5/jgb0Oh5sIVrSW7I5rqA9eqIxFP2u7qo5EZciX6GF6Vx/Nn5e2faMYbKEgGZSm7bPkw +E+zM15uP7Em+dw/3mULgzNkAQsy3AoYYAT1rgjhB1bmL5IxKRpl/jPEZEEbJonr01361SPaL EMJ3I6S+GgSzJ+ELwXTFYEhgnBCbHMjFV9bOCKC0oybonR6FNgFY+46Wi5ojRal0ioFxwNeoV ePwVaLQuhqJSZVVdJ0Ddpu/b+wU3VkgOTzhew+aKyy5Ui1SPCkPigtnO848ax0qBNnkZoR3YE hjQHGbzRKV5F/U0TuBkYuF+j+PQ8hMg7L2l/VIGr76f1lj98+QOtjwCMhKmlubjN9cOESuev7 mENYAmK0/px3WVnLca/kxhmPtY6WNBEfHAWI8rVDz8XmOjwIo6uzoTb266RUUJLbsDd2FSDop egCzENiNyUXChelC1BFgpOdux79jBwGfadx3VA== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/staging/media/imx/imx-media-csi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c index 5a195f80a24d..887fed0c3ce0 100644 --- a/drivers/staging/media/imx/imx-media-csi.c +++ b/drivers/staging/media/imx/imx-media-csi.c @@ -1004,7 +1004,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;