Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp480827ybl; Tue, 28 Jan 2020 06:37:19 -0800 (PST) X-Google-Smtp-Source: APXvYqykP/IXaiBT5KhRnCECBm3A24hpJiSKGIMoAHHMqd4eg6UJ1TBQEARk47iMViZyPFCcAsIR X-Received: by 2002:a05:6830:1257:: with SMTP id s23mr16607975otp.241.1580222238949; Tue, 28 Jan 2020 06:37:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580222238; cv=none; d=google.com; s=arc-20160816; b=dj2QHBQa6sFgCvDRAYoYFIo9S+4qicGelVyDUlLr/HY8N/IwFn85CY//zY+LV1g0gS cVNuRQ7Nqh1U2Jr18sJB3kDtKDtmX4kgXsLsnskejtagNX3zNXs9Ej7rqf5mWu61pfAG WYaMwTSloLq+HX/DqLB38NKRFylAcXBFKMxSF6aesO3f3OtzwtMPSjBmkP4+8DYir8QI SnJhB1gkZVSnqPdR/ta5diVz2Xl+wyhkAZga9gdcK8aisXAirsOcducdTuVcpTN+P44t u2jf8Ds8gDLh4/gbJmrZIAyXABL+T+hmnWDhVhnHGymLqtEU97jwWGo2Fb1YKNg1EvM8 XNFw== 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=mR6uMkg1JLfYHsGPXEtMWcFeHhyaPG7WdAPr1UXKBcY=; b=yP9ck38CMGpyLe05qmR0PC9igmHh2/7AGVwOtRUL8uMEBMxp8oqW6Y6W3/IQO5LD/p S9Cbh+sUCxSeyhxeYlEe9a5u4XNcfcJFhjU05XBA3AYRLqFcDGO+yyo2rfRvPpI7MAQV HWxQtcESSUe8TxXi2gYZO3oKbY7WxqPJxfEk6HrMgJbXNeJM63Qp9GhaNvDcZkueTyy4 3JLor0xFvzoj67cyVeu5UTbaX6VldBVK7QeuaRca4YkDtTNZNH07hHfG19hkwsCEfx1k gPK17U9nszo2nvkj8NoRaT/ULfUJgK31QYGu6XFR4kpFsmMWHv0v3/mBG9Gj5RKarN69 4Puw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rtEiGJNA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 v76si5310423oif.207.2020.01.28.06.37.06; Tue, 28 Jan 2020 06:37:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=rtEiGJNA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387524AbgA1OfY (ORCPT + 99 others); Tue, 28 Jan 2020 09:35:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:36430 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733226AbgA1OfV (ORCPT ); Tue, 28 Jan 2020 09:35:21 -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 618A221739; Tue, 28 Jan 2020 14:35:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580222120; bh=uU60ciiTrDJ9OmBJPBS8Wl7CIQw1suWbyJQyUdYfXqM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rtEiGJNAwssHukqnFMM2EjX0sgdjS900txpkDYKEEHtOcE5HXyk6TlgiYOC0/rx5L DMvZ/enIJoGYHHYIVKiEoOHUuzBX4/rR31Go4mRMGndvnxs1QBT2ICXkhKBWEyOxGC Zdfj7XJWnIwu8/RY1DYiYVU38yBGRtuPwFSOTBo8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Nathan Chancellor , "Lad, Prabhakar" , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.9 107/271] media: davinci-isif: avoid uninitialized variable use Date: Tue, 28 Jan 2020 15:04:16 +0100 Message-Id: <20200128135900.546687585@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135852.449088278@linuxfoundation.org> References: <20200128135852.449088278@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann [ Upstream commit 0e633f97162c1c74c68e2eb20bbd9259dce87cd9 ] clang warns about a possible variable use that gcc never complained about: drivers/media/platform/davinci/isif.c:982:32: error: variable 'frame_size' is uninitialized when used here [-Werror,-Wuninitialized] dm365_vpss_set_pg_frame_size(frame_size); ^~~~~~~~~~ drivers/media/platform/davinci/isif.c:887:2: note: variable 'frame_size' is declared here struct vpss_pg_frame_size frame_size; ^ 1 error generated. There is no initialization for this variable at all, and there has never been one in the mainline kernel, so we really should not put that stack data into an mmio register. On the other hand, I suspect that gcc checks the condition more closely and notices that the global isif_cfg.bayer.config_params.test_pat_gen flag is initialized to zero and never written to from any code path, so anything depending on it can be eliminated. To shut up the clang warning, just remove the dead code manually, it has probably never been used because any attempt to do so would have resulted in undefined behavior. Fixes: 63e3ab142fa3 ("V4L/DVB: V4L - vpfe capture - source for ISIF driver on DM365") Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chancellor Acked-by: Lad, Prabhakar Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/davinci/isif.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/media/platform/davinci/isif.c b/drivers/media/platform/davinci/isif.c index 78e37cf3470f2..b51b875c5a612 100644 --- a/drivers/media/platform/davinci/isif.c +++ b/drivers/media/platform/davinci/isif.c @@ -890,9 +890,7 @@ static int isif_set_hw_if_params(struct vpfe_hw_if_param *params) static int isif_config_ycbcr(void) { struct isif_ycbcr_config *params = &isif_cfg.ycbcr; - struct vpss_pg_frame_size frame_size; u32 modeset = 0, ccdcfg = 0; - struct vpss_sync_pol sync; dev_dbg(isif_cfg.dev, "\nStarting isif_config_ycbcr..."); @@ -980,13 +978,6 @@ static int isif_config_ycbcr(void) /* two fields are interleaved in memory */ regw(0x00000249, SDOFST); - /* Setup test pattern if enabled */ - if (isif_cfg.bayer.config_params.test_pat_gen) { - sync.ccdpg_hdpol = params->hd_pol; - sync.ccdpg_vdpol = params->vd_pol; - dm365_vpss_set_sync_pol(sync); - dm365_vpss_set_pg_frame_size(frame_size); - } return 0; } -- 2.20.1