From patchwork Tue Nov 19 05:18:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 179669 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp159548ilf; Mon, 18 Nov 2019 21:38:44 -0800 (PST) X-Google-Smtp-Source: APXvYqzfaudLKJr/JBWDAJHahLkQ07so8pSMSB9M4b9BSlT90fvy8sJIA+vRQxnabnglCmA1v8z2 X-Received: by 2002:a17:906:bfe3:: with SMTP id vr3mr31984414ejb.273.1574141924389; Mon, 18 Nov 2019 21:38:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574141924; cv=none; d=google.com; s=arc-20160816; b=cT5nyyR9rjO7ZyYEDHqVfdDbdutEfvhyeYRL3W2gaGku/njwwPzRn8fRnN6ewbd19H 8hBgMP5P0qhqad2qc3lTTjwvsIhcEOGXnqb57zpS0lBqLjKadQui+4768z4sP1tELsDM snIQM173O4vR83MAuPOkxz+R/qu5QSZoczM0ezNbmVE5BWlHxLLj8zoSubCZeFkdlUnF +a+2gsLX2eb1pF4cO+b/rXFf4NbcpCeMWfzmSsTeTfltFifW40BKv8btQnNQkaY0kbbG 1Dw3ckeBACMmeKBZ+3b5EylrrGdwybym+oiK7V4STo+/45tZtRw2yMUmLKfvLZlTALLW Kx+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=To1s4uB6jy65ogLirdh5wFHDHLuD9h4K09YupexMECI=; b=f1g1O1gitlYo0SGS+wR96Kiqs5SfqbN7j1Lj/Ulhmn+kfbT8sem1nNpamcUicbQKg4 XlMj7WRrJxLcq+J6rHlSMfis0d34KdD+ezplnm+9TTh/OfQQKIAlvTHtYaDr1kO66iR9 47TovgDJLg0/vhNxBa2CLH6jUzDvg1oTRU2raeMltYURORBm5LEAxiDSCqQxE57VF9+u ooIK173MMGiJ1jzl2aDPSc5cHmv+Q6NXeggKIMcmhhzw62EVeWWaGoppQ/qXYx0sMOXo FrfQlxsFJBDnaa5f1D9YhAxcIihNY0/uCZuH+eBUHcG+lyRP72OgqgvVrLXL1pGKm6za JghQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xHX+StIM; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 w19si4402249eje.290.2019.11.18.21.38.44; Mon, 18 Nov 2019 21:38:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xHX+StIM; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729061AbfKSFil (ORCPT + 15 others); Tue, 19 Nov 2019 00:38:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:60716 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729621AbfKSFik (ORCPT ); Tue, 19 Nov 2019 00:38:40 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CA180208C3; Tue, 19 Nov 2019 05:38:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574141918; bh=tlbUosy2fq8Q/oWAJId8gRxFvS+jxOmsLcfyNhEtnSc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xHX+StIMKIHms4csQztj0Qg2r4e2YpE5gBm3GLTGhr3Zqi2y2c03gZ+KqCKKooOak 6bZDE9TICfIpgrmOZO1YBRx1TQEksb7lx5q/okCs8ycwnB/TsfhPEV8+jnah1cmUEx 73NMCJtpOc7noWWATai6OFjMnEa3j8aSitvdizVQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.19 326/422] media: imx: work around false-positive warning, again Date: Tue, 19 Nov 2019 06:18:43 +0100 Message-Id: <20191119051420.140254143@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191119051400.261610025@linuxfoundation.org> References: <20191119051400.261610025@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann [ Upstream commit 8d1a4817cce1b15b4909f0e324a4f5af5952da67 ] 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 Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/staging/media/imx/imx-media-csi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c index d17ce1fb4ef51..0f8fdc347091b 100644 --- a/drivers/staging/media/imx/imx-media-csi.c +++ b/drivers/staging/media/imx/imx-media-csi.c @@ -166,6 +166,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; @@ -1072,7 +1075,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;