Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp717009rwe; Fri, 14 Apr 2023 08:50:33 -0700 (PDT) X-Google-Smtp-Source: AKy350aM1o1KqoiKLO4orBEyYpPpz1FB16UZGbJ8iO4hJzDjOlGO3sHgZFQ4Yjk87SZbl7Uquqrv X-Received: by 2002:a05:6a00:10cb:b0:638:7e00:3737 with SMTP id d11-20020a056a0010cb00b006387e003737mr8064541pfu.23.1681487432859; Fri, 14 Apr 2023 08:50:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681487432; cv=none; d=google.com; s=arc-20160816; b=FTo6IWKJLJellM/RO2R1cgQaHOBvNK0mt93N8/vMgI1HhyDlPiEkAL/IyuvipOZxyc v9RtUCSysQlAa4z4kz6GubGraxrG3Bd6Nerkc32KewwhG6hv6V8jj6Oz9DFZQA0FsorI ZnVePdC4EGV7Q/rvqbXhGzTmaLR85HQHl5vk8pDUcaYZWHNkYoJXCEF5v34iQs4TKI/b cGueRsNjq2ueze5KZ4BXzYeFqANKXEzKMX8afgzty0uHY/C8qSSpMRdlaksiZkMTbnFt tvg6dXSttDkeOOybCYiRxxlorusWB/micInVzSa7tErJsOjiTYIaw0V6KDinF6UTbgil XseQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=DRvxbtg4TLMXWEtNKwgZL7ymqxLWZKIhhr7kd8u6I78=; b=Z7+tT3ziHk697NIEbH0DhlHv+zcFw0gkKD29wdi6StR0A2tmEb6BnpNWURO5rSLfdS xNbNc4FZ7Nu7BnN1zqA2J6fKWVi6vLROQP6enJW82Z0uSrl7XO2M8Fa/o7OmEiXXnsg3 oxx5W2KXC295pJ9LxOv7fpo5CtrP6TdpprEfnYo103zDxJbJODLZoedO3eAsmFMWurp/ yhXw2g5Td49IugfbycKLMfDpVIozmQqJR0gMq2MBkwKLup5aetg+YKRaia35+VY+e9py cy/hC4yMUoHpUp1pwgHac1NF2deUYXfhR8g20Hlt+KMZkLsZU5/oTUiT2egytwLmUfLd QJng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=D+M4c8lZ; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d17-20020a630e11000000b00513ac21a77bsi4963405pgl.880.2023.04.14.08.50.18; Fri, 14 Apr 2023 08:50:32 -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=@kernel.org header.s=k20201202 header.b=D+M4c8lZ; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230137AbjDNPtx (ORCPT + 99 others); Fri, 14 Apr 2023 11:49:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230112AbjDNPtv (ORCPT ); Fri, 14 Apr 2023 11:49:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6647B772 for ; Fri, 14 Apr 2023 08:49:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 16E8F62212 for ; Fri, 14 Apr 2023 15:49:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C7CCC433EF; Fri, 14 Apr 2023 15:49:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681487364; bh=5DqrhCTzuzTjvwCGlt19FA3g4stRfeUyytfgLiO4ps8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=D+M4c8lZ8CKUyLB4075G4N7ODWaHSg88hJWbhdpIVYS8u7hwMnq7mfLEE+BniHyD6 asCaVPm64ZeLyeyNT+N0Y6+uXFBgz8E7bJygkylSKH+9QA5IJT9yttrVxK6jqwCZfv mcev16XlcOWWVwZqZa3svHdx6UeQN9splmLRfZ6PUJB4OMfgKLqihc7YlLo9sHiy4Q ENYiYmQlt6YadBkHXG74JdINOamfMUJaUkXICj/tm4hnGviEnjxRcTG8fREkzOHriy Ove74Hq/km8t/N+sARfWLfYXXZsnOPXx4Kgf6P5LpHKBJ0i71O0haS/6m03hvzia75 FkmDD8tCgTO1g== Date: Fri, 14 Apr 2023 08:49:21 -0700 From: Nathan Chancellor To: Tom Rix Cc: chunkuang.hu@kernel.org, p.zabel@pengutronix.de, chunfeng.yun@mediatek.com, vkoul@kernel.org, kishon@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, ndesaulniers@google.com, granquet@baylibre.com, 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, llvm@lists.linux.dev Subject: Re: [PATCH] phy: mediatek: fix returning garbage Message-ID: <20230414154921.GB1931632@dev-arch.thelio-3990X> References: <20230414122253.3171524-1-trix@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230414122253.3171524-1-trix@redhat.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Fri, Apr 14, 2023 at 08:22:53AM -0400, Tom Rix wrote: > clang reports > drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c:298:6: error: variable > 'ret' is uninitialized when used here [-Werror,-Wuninitialized] > if (ret) > ^~~ > ret should have been set by the preceding call to mtk_hdmi_pll_set_hw. > > Fixes: 45810d486bb4 ("phy: mediatek: add support for phy-mtk-hdmi-mt8195") > Signed-off-by: Tom Rix Reviewed-by: Nathan Chancellor Angelo brought up a good point on another patch to fix this issue that we should probably be returning ret instead of unconditionally returning -EINVAL but it sounds like it does not really matter at the moment since mtk_hdmi_pll_set_hw() can only return -EINVAL or 0. https://lore.kernel.org/ada769e0-0141-634f-3753-eb3a50f0eee3@collabora.com/ > --- > drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c b/drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c > index abfc077fb0a8..c63294e451d6 100644 > --- a/drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c > +++ b/drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c > @@ -292,9 +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, > - PLL_FBKDIV_HS3, posdiv1, posdiv2, txprediv, > - txposdiv, digital_div); > + ret = mtk_hdmi_pll_set_hw(hw, PLL_PREDIV, fbkdiv_high, fbkdiv_low, > + PLL_FBKDIV_HS3, posdiv1, posdiv2, txprediv, > + txposdiv, digital_div); > if (ret) > return -EINVAL; > > -- > 2.27.0 >