Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1059974rwb; Thu, 8 Dec 2022 06:21:03 -0800 (PST) X-Google-Smtp-Source: AA0mqf6oQ7TrmJffBReDdSCj+q+2UReGpMbNu5aF4U276sTtWAbPX87J26mpIUdvrOl2rMUAdobH X-Received: by 2002:a17:902:ec04:b0:189:894c:6b58 with SMTP id l4-20020a170902ec0400b00189894c6b58mr52569135pld.172.1670509263710; Thu, 08 Dec 2022 06:21:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670509263; cv=none; d=google.com; s=arc-20160816; b=gg87wymTGOaRYnVWaJ71QQGJ+srSLyeGjGfkGsguQ/uqINfcu+ZaR8z3449Jf4gqS/ xp/z1mvGNNvtjS8a/PW3K2pHsCXkX8lAdJOL5Ra6OP/FRB7cVlV4MCRHEYFkHZpfvuYG 7bi7RJFJpgX/GTA9xs/Mt7yIu9AvXXDtqPTgRdymR+tpfXwRK4zw/QWlW6NwL2DDtLCR YxGKaxosvOHxuCmXEUg+bdI0lEw/57/UmMSMKrN+Lg47rPrntTqUJ+tYBqenp5zJw3FI ruU2TvmsBleLa48uNVL19duo8oeaKnGx57UJvewWDkyajBDzeLaSg/zMfD5pJp3eiEG8 5zjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Nq7On3/y97eL5Yt3PQUNo7Mzs47XouX8Q1gOqpBPXDc=; b=ASHnwIZUZPXNxjtmpV0RhUx1fy4F5dZMUl58CySjpeCZrmniL6+akFTrEjWaf9UHzt GOcZTueLbPGZQh47rLtv5o7LT9xYt4oMBr6sfkws6Esr6MZ82IQNnynE0RVyGE1c+UTf aDTQA/dXWzbJ/u5lVhirraAOWbX4r9f3B4tR9QzWkSKqZk5bQlZHSoQYES6DT7gzrWEJ swJFWy+fXNSVFeynbMiAArMTlG+OJSAvN5y+87u0drfjG42oETMPMqeN3aeH7peu/0OZ MTaxYwkZ0X/SDZzzmPzma3hal0BRqEGQQn4JRP61eNOagvwqO2AuQcK9q7pD8z9/OQsQ cWqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="J/THxsNh"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nb8-20020a17090b35c800b0021901063557si4573898pjb.23.2022.12.08.06.20.53; Thu, 08 Dec 2022 06:21:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="J/THxsNh"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230408AbiLHN5I (ORCPT + 72 others); Thu, 8 Dec 2022 08:57:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230155AbiLHN4q (ORCPT ); Thu, 8 Dec 2022 08:56:46 -0500 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2643A94904; Thu, 8 Dec 2022 05:56:20 -0800 (PST) Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id D71FB20008; Thu, 8 Dec 2022 13:55:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1670507758; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Nq7On3/y97eL5Yt3PQUNo7Mzs47XouX8Q1gOqpBPXDc=; b=J/THxsNhU5N4VNjkAPqUJbmMI7vwW/au9AbsoYcoN680padhO4NtmvAtY1cmNN/NunRQOX VuErWPdwnuH7UtIgYwJ5W5GsA0WJ8DKupV8fEhdhnQbJfkcrd7/R/rhob2myu5ncQNnyOY QQe6MATssN5e30DdYRhSUf+VGvNcZti/DglFVFM0uwIlhtZU3aiPGJY+xdky3tTFbPl/zM IV6bNDvtrH4HG0idUsPSBR8Q+NerTDhMK1QBsttFlXyENfY4LalKwZ7ElkQMBT7GjlWarq la84xQiFFQduPYUzM64BSc/HRpkJIroKny26ZkDyyqsAiG96btRCaaTxH+D41w== From: Paul Kocialkowski To: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev Cc: Yong Deng , Paul Kocialkowski , Mauro Carvalho Chehab , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Thomas Petazzoni , Hans Verkuil , Sakari Ailus , Conor Dooley , Nathan Chancellor Subject: [PATCH v2 10/11] media: sun6i-isp: capture: Fix uninitialized variable use Date: Thu, 8 Dec 2022 14:55:11 +0100 Message-Id: <20221208135512.421903-11-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221208135512.421903-1-paul.kocialkowski@bootlin.com> References: <20221208135512.421903-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org While the stride_chroma variable was previously initialized to zero, it's actually stride_chroma_div4 that is set to hardware registers. Initialize it to zero instead to avoid an uninitialized variable use and get rid of the associated smatch warning. Signed-off-by: Paul Kocialkowski --- drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c index 4b592820845a..1595a9607775 100644 --- a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c +++ b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c @@ -108,8 +108,8 @@ sun6i_isp_capture_buffer_configure(struct sun6i_isp_device *isp_dev, void sun6i_isp_capture_configure(struct sun6i_isp_device *isp_dev) { unsigned int width, height; - unsigned int stride_luma, stride_chroma = 0; - unsigned int stride_luma_div4, stride_chroma_div4; + unsigned int stride_luma, stride_chroma; + unsigned int stride_luma_div4, stride_chroma_div4 = 0; const struct sun6i_isp_capture_format *format; const struct v4l2_format_info *info; u32 pixelformat; -- 2.38.1