Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2379405rwl; Thu, 13 Apr 2023 05:52:50 -0700 (PDT) X-Google-Smtp-Source: AKy350YPQpM8PB0JFByvddEuycELkE6cUKnDNKvq6dvBGlVOP/Tv2Deta6JAnfc8+oR6cFnAOWfA X-Received: by 2002:a05:6a00:2313:b0:639:c88b:c3e0 with SMTP id h19-20020a056a00231300b00639c88bc3e0mr3362079pfh.22.1681390370426; Thu, 13 Apr 2023 05:52:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681390370; cv=none; d=google.com; s=arc-20160816; b=x93hHp5KMjycHh+t+sSVAfiq2UwjjB/r6HTKfwrbW6NaJOWBjaU2xeotB9z8xhrN+T PCJGRbkbufhSMkYj1Tkf0DJ35iR9NlJvx89If9Gzke6SrA4djdRtKw2vCJ08s4aeTadG NN8uQCuHiQ2RD6Kd7xWN+4F31892fzbKyXPHn3/oZuewmbqsEjNbDMooYuNr7CiH7LOT 34ME1ExccyzMAKM6X5cih13LoIJYxJ0J2mc8rpOtW4gPwP4Eb8U5KEiSMkwCGQczi1aR OL6iHUvHiJWolDlRitUEq/viD5rw7YtuhN6fgk5kWAG758btzlp9+fQCsThd9fQa78ZS BBcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=pfiB0dyNF5IN+dDnQ49hhgOP3vgf9O+J5xAGBbme+xg=; b=JMm2ynNsFRzsonmoeUG/ngjxDZDfo61SIJvnVR0CItA9lojVdiD7rcCpGg0+fVXjDC 59f9TBIm1CGxJCFN4cHljTvv6BImfGQtLQJaZOdpgW8VypMi4QP6RWunaYG6vUkuT5XN dvNFip6L8nXYr3eEZQeTxp5KTshSqmU4p8P4oHZplU3HuVcHUtPqr8ao1xBfyzkmXxQk CfcnbEy8555BTleW+vfd7KWbrQLQQZSciWY8NenGpkmsn9+wXaL+Pf2XwNMyKhRlf+3I TPhL9XiO24boe/oe+qKyXRZKEnMpd3HF/L2TEA1edvg6GRNZUtF8CvjkxuYZG3eEGdql ADpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20221208.gappssmtp.com header.s=20221208 header.b=jt9lPv4l; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t2-20020a654b82000000b00517aa9db92dsi2017798pgq.396.2023.04.13.05.52.39; Thu, 13 Apr 2023 05:52:50 -0700 (PDT) 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=@baylibre-com.20221208.gappssmtp.com header.s=20221208 header.b=jt9lPv4l; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229604AbjDMMvt (ORCPT + 99 others); Thu, 13 Apr 2023 08:51:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230057AbjDMMvn (ORCPT ); Thu, 13 Apr 2023 08:51:43 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8B6CA266 for ; Thu, 13 Apr 2023 05:51:41 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id k36-20020a05600c1ca400b003f0a7c483feso1021862wms.4 for ; Thu, 13 Apr 2023 05:51:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20221208.gappssmtp.com; s=20221208; t=1681390300; x=1683982300; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=pfiB0dyNF5IN+dDnQ49hhgOP3vgf9O+J5xAGBbme+xg=; b=jt9lPv4lNrVGnYs0/3pm0ZbWLL22vClDmV9Mi1AjKNPGPhp2Z1qGKvnTZxfZ2IH6Va kdWB9Vni+Q2YbR5aVEZCe1q10+kzpEoLsR96keXGahTbBCxs1Gw4Rf4FvtwtSZ7HVKN3 C81hq4PEchuYqdXF9E0329vVtPniqlkTwnJJ+uxVfTuZcKBHUJIiO6LOLKb21khCxIfq KaSXyJEqR4mqIBxAuPCklrrhmsA+bnWVtMAjwFperuNLjMPZ2+tDlEdIBc5Io+l0ofVe E9obFN/51kCQ1pDsVpsDL0sTjweGDhw6VzcDBOGCHtbPxDwugox0FApsENkM9nt4vwjQ tf2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681390300; x=1683982300; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pfiB0dyNF5IN+dDnQ49hhgOP3vgf9O+J5xAGBbme+xg=; b=L9U8JWvTjfuS6DUoHaf/8Tk/mo99hSlwClu1FYICF9qVIlLAAzlRWfatm5MztFwY55 kv57CFTJobm5nwxpElAzBx7QErnQ2yZly0AcD+eGXdz+uk7aJQehrdPUUa0qSWo0LP/H UlDdcNAe//xKZYxW2I5FFrTRk2Zl8MAC3hH8c1zLRcOLy7VZEQ8+IqdKI340vgHONAXI 0lbAbySpH3u5FvXbc4NimcHOCA9l5BVSNtQVKFNO+jyQAOBO3BHKcVD8pyv+RhYZbd4i UgS7J4BMqBm3kgPQu0x1gYFMj7bbaVwXX/ptSVZs513cI1rCSODnrUbZ/BQQkCSBulIT 65wA== X-Gm-Message-State: AAQBX9d2P1UQovyMxQ7hmTbpuSU0J0xy01NAQPGMXtk2h6juoNjzeLgr eRgcVY5CbsY8pGreUn2mlxFRMg== X-Received: by 2002:a7b:ca57:0:b0:3ed:4685:4618 with SMTP id m23-20020a7bca57000000b003ed46854618mr1728570wml.34.1681390300370; Thu, 13 Apr 2023 05:51:40 -0700 (PDT) Received: from [127.0.0.1] ([82.66.159.240]) by smtp.gmail.com with ESMTPSA id k17-20020a5d66d1000000b002f67e4d1c63sm156356wrw.12.2023.04.13.05.51.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Apr 2023 05:51:40 -0700 (PDT) From: Guillaume Ranquet Date: Thu, 13 Apr 2023 14:46:25 +0200 Subject: [PATCH 1/2] phy: mediatek: hdmi: mt8195: fix uninitialized variable usage in pll_calc MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230413-fixes-for-mt8195-hdmi-phy-v1-1-b8482458df0d@baylibre.com> References: <20230413-fixes-for-mt8195-hdmi-phy-v1-0-b8482458df0d@baylibre.com> In-Reply-To: <20230413-fixes-for-mt8195-hdmi-phy-v1-0-b8482458df0d@baylibre.com> To: Chun-Kuang Hu , Philipp Zabel , Chunfeng Yun , Vinod Koul , Kishon Vijay Abraham I , Matthias Brugger , AngeloGioacchino Del Regno Cc: dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Guillaume Ranquet , kernel test robot X-Mailer: b4 0.13-dev X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,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 The ret variable in mtk_hdmi_pll_calc() was used unitialized as reported by the kernel test robot. Fix the issue by removing the variable altogether and testing out the return value of mtk_hdmi_pll_set_hw() Fixes: 45810d486bb44 ("phy: mediatek: add support for phy-mtk-hdmi-mt8195") Reported-by: kernel test robot Signed-off-by: Guillaume Ranquet --- drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c b/drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c index abfc077fb0a8..e10da6c4147e 100644 --- a/drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c +++ b/drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c @@ -213,7 +213,7 @@ static int mtk_hdmi_pll_calc(struct mtk_hdmi_phy *hdmi_phy, struct clk_hw *hw, u64 tmds_clk, pixel_clk, da_hdmitx21_ref_ck, ns_hdmipll_ck, pcw; u8 txpredivs[4] = { 2, 4, 6, 12 }; u32 fbkdiv_low; - int i, ret; + int i; pixel_clk = rate; tmds_clk = pixel_clk; @@ -292,10 +292,9 @@ static int mtk_hdmi_pll_calc(struct mtk_hdmi_phy *hdmi_phy, struct clk_hw *hw, if (!(digital_div <= 32 && digital_div >= 1)) return -EINVAL; - mtk_hdmi_pll_set_hw(hw, PLL_PREDIV, fbkdiv_high, fbkdiv_low, + if (mtk_hdmi_pll_set_hw(hw, PLL_PREDIV, fbkdiv_high, fbkdiv_low, PLL_FBKDIV_HS3, posdiv1, posdiv2, txprediv, - txposdiv, digital_div); - if (ret) + txposdiv, digital_div)) return -EINVAL; return 0; -- 2.39.2