Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8265292ybl; Thu, 16 Jan 2020 13:32:57 -0800 (PST) X-Google-Smtp-Source: APXvYqyYMr5osDLv/D+V8+qU1epgebnphpBqGGm1BG4FqEKmlKAIPqvpAe9yf8bZMOgSxzRFGytw X-Received: by 2002:a9d:53cb:: with SMTP id i11mr3818549oth.158.1579210377141; Thu, 16 Jan 2020 13:32:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579210377; cv=none; d=google.com; s=arc-20160816; b=pbU4Fyuh7kZUMADEf2duvbM8HaGbgOdyqMq+A2hcsBeYRcUnXmKkPaTeK67OtSFvnm DQJ3UvNqiepfBQOEFKJ0b/BItYkECCm+INNje8DnesrxgD5bqpdQM/Dy6qLUmKyGxSGO aMH2uj7ttwGqikTiEvMzoLRAbeQBu3S5UCSL+ZzL/xiOycAa1fE3Rt2MeX5L+9MbZopR p3MWcdyDMIJJb2IFxA9g3WI//8vGwxwDAgjxW7jDaxKt90gyYZlHxR2zyqo7m8SJUv+Z HH8YPR6TSaxLJ+dq+KhwSNlA6fZPGv4SbWEsCyE3EQNPhJMA5MTDKZZVBmk2ZNH154Cx zbLQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RjzLeAgibMTsaMa4dYwRNJF7IgeaCKCa6hcLWyiT1xI=; b=g7Zw4GFGctLhobbPX2cFePc77t8FwBRqxz51Xj2IaBYgYzcRCn77S22P+3lAeBqe3y mNWZBYHeq09CL+qrZWEY+sp7MZak+IDNOZJAS2KgiVz4tFgLJyKGDArtTeyaVOdxBknn O0oPu/rSzSHBi8nOqeOMYXGULRr09r1/Gg4XLYsoxSHuYuiS0eNmJ1J8ih//4ZiruKBt dRv8bkwaGUv1bk1+jC2iS6lzB9EhjQpmtgXpuvBHXU90ahNZXEQSoeIxf+xosHof8icL dYio4+QwK+poY4QhIV09XAOJ7qPittSExnKls9c81RlzLbjvaFGTKkiNC2z1dLBltVM4 Kw7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QK1imqXp; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p21si14826688otk.162.2020.01.16.13.32.45; Thu, 16 Jan 2020 13:32:57 -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=QK1imqXp; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388121AbgAPRip (ORCPT + 99 others); Thu, 16 Jan 2020 12:38:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:53934 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389965AbgAPRiL (ORCPT ); Thu, 16 Jan 2020 12:38:11 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8E05A246C3; Thu, 16 Jan 2020 17:38:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579196290; bh=QNGO+4h+4tv4Cjbm89Vwy1rtiuhXMwGt9Ox0SnAPSOc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QK1imqXp+k9/9NFVCgciT3I0li/54tXXNxYkhYQzTAslzhyvoXo3xqjFcLsDui5of XMQu87GL/MfAFQ+xvY8+NDF0wFfBhTPtI8xtQD+pSNub8TNLoBoigjKb4yhCgl2QPI ZyGO0FDrPkJeuAUHfQ+FxhrKx6EH4Et7yoDLvC7I= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Arnd Bergmann , Nathan Chancellor , Lad Prabhakar , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin , linux-media@vger.kernel.org, clang-built-linux@googlegroups.com Subject: [PATCH AUTOSEL 4.9 105/251] media: davinci-isif: avoid uninitialized variable use Date: Thu, 16 Jan 2020 12:34:14 -0500 Message-Id: <20200116173641.22137-65-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200116173641.22137-1-sashal@kernel.org> References: <20200116173641.22137-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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 78e37cf3470f..b51b875c5a61 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