Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp739229img; Fri, 22 Mar 2019 07:35:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqxbKjfvA2yFLHnP0EsBXh1i5ENyjKCgA9p7toKRgpt1cVE5uqWK2KWJMEsNsccbTYEd7yBt X-Received: by 2002:a17:902:bf0c:: with SMTP id bi12mr10001607plb.340.1553265358189; Fri, 22 Mar 2019 07:35:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553265358; cv=none; d=google.com; s=arc-20160816; b=sb8+W9hzrjOQANDSYMCSo2DCIKEUlNFKkG66zaSxzHrVTb6XMzbWY4tT2w0OTVCaaE 3WeD2Nvx0Ra5WRoLVWNOC2c9HuomrNnbW16l+CMqy68bt67MdeQwHtB3fSW0vaMRe2sz Ot9HrpB4YtnqNb+qTrHYRLZAnKg3UkT/Mzp7kgvthzyNCRwIyQzYdeqa87MT6QRb8qtG LGHAnoeT8/x1xRANlaVo2gfSXv4apEO7iy5EGd1hplV3TejdFxWC40aTkInM0zjcnzGw kf+HoNlaDmWAPRMbNL+lcz1WsqDpwhtR3DUUmbHV956PvIzMPfhZIB4u/+sn0wdCSnLY 4a5w== 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 :message-id:date:subject:cc:to:from; bh=VCmtgIyXqQCwlJy9YlHZxv00kt6Qwc+OQgJHGWwtCSE=; b=ug0BMsxJEcjT4cJvotMkZ+YdyMvAY+caoyMckSNnzhDUC9vguv8RLr7M9TQEV9Yddc 5vB9LWZ9dOwA6fIm1P1XQX7GCrXSzhwtQcvxIJS0QMt8RnDqBtxigNhJ7pV2zuohVeTe k8JIgTnsBft+PrznFm6pZZnavzOfPt6wJYOfGWDEZ9ooxRjfjbDOoe5DFo9e1cGAaNIy MJwvz471uuQk3POgzZo3ygMo0k3cu4+ZBJcY7rG94c2gdLJGL5+rpJEqf6WGwuZnw6fQ 5mLM0Ag/URK5qBFiESshhhm2Qqo77lVqszoDgU2e6iajD/bK/6hwKTdpUY7x1dzMd3v7 xO4g== ARC-Authentication-Results: i=1; mx.google.com; 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 g1si7036645plt.318.2019.03.22.07.35.39; Fri, 22 Mar 2019 07:35:58 -0700 (PDT) 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; 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 S1729131AbfCVOer (ORCPT + 99 others); Fri, 22 Mar 2019 10:34:47 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:45333 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728991AbfCVOer (ORCPT ); Fri, 22 Mar 2019 10:34:47 -0400 Received: from wuerfel.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.145]) with ESMTPA (Nemesis) id 1MCKO4-1hGeds0802-009NoR; Fri, 22 Mar 2019 15:34:34 +0100 From: Arnd Bergmann To: "Lad, Prabhakar" , Mauro Carvalho Chehab Cc: clang-built-linux@googlegroups.com, Nick Desaulniers , Nathan Chancellor , Arnd Bergmann , Philipp Zabel , Kieran Bingham , Wenwen Wang , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: davinci-isif: avoid uninitialized variable use Date: Fri, 22 Mar 2019 15:34:22 +0100 Message-Id: <20190322143431.1235295-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:gWJLB09DU6mBS0YO7lWkZjIeBdL/QA0QBAycFVPj99/UjNQlJ2F JvaNabZuw522vpYWlISa17jvyfjzEZlkEYkIm6go6C9pyh84ond0U48+AREkoNULLrRH8YF YPL/Gu717BbllllXU9RjrLtgaFBV0/wTXZ2KM96SBH5I1rrJwkT4ficg4E/RdzsJETDUTXU cRzCSLgaCCUqygHhjHpWg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:0BRdmWIO31I=:jlkRu8gFJiDS6D+V9NjMeQ pqCagyf4GbdoakItMLgRcWcjObKfpMbKtGlMhF9S2UTwNU69SQcc/kJ3N3ovIqutQs2E6V1HW JBF1ut7l44t/wQkFW08jkc2hkh1/RhEHmDElgNzAG3w8kW4Gb94MeWX45s2GR0Dd7v8KDyiuk k1t5ZAtlpM2eZoaAmFfnayggT1QzrIRvx2BRZAfv9IrwU9KSgXSHoHq4O3b2+7wYlrx8jn6zY NrRxssle7LKGq75wqE5hkIwrvccVD4qpU3O02ZhqgTEaISfo+qQB6SqA7W/Chjq+EDP8Aq8FT AxeuXoJUe0LXS2UeFNlHTSKifrIQPUklcTGpvTAUEzUIPtkwBwmkayYjXWzcxE4itVuH5ZOba 6hUzqz92EspfUwEIeksfbM+FtKJeAsMSgZBw975jGYE7/NYs5gqsk+d2A5NFyhntEmx/fhfQ6 KpWL+h4uoUSP9ahkHKNBCDMhdzhjhw4OMfOhVtziQBQVSyAU5/6hl5NiyhzmGovYFx4Cl/GiX dztouBecJRM+RFpFYyPFXq40AEn8B+ZEiPOxbRe6MacpowDY71mAsFq+PliQf1PJCYy3Cris1 ghCwP2VbKnvp5HRCZmUObg+pDD6wpIYeoZBY2kjDULFdUvRyYWFFXAGIjQQ+HLf/JWLPkhc+m T52I9f/932kyzAMjbr8coqLQDQ8yHtzxURDt2PCTZgd7OpNhZeh55ET+QNGkq+iX/C6qaSi+j PloBjhMQfwlMuRUuPAclU0m8wP3lhzZofsDjDg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 47cecd10eb9f..2dee9af6d413 100644 --- a/drivers/media/platform/davinci/isif.c +++ b/drivers/media/platform/davinci/isif.c @@ -884,9 +884,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..."); @@ -974,13 +972,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.0