From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9BACEC7EE2F for ; Tue, 13 Jun 2023 01:07:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:To:Cc:From:Subject:References: In-Reply-To:MIME-Version:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GJkbeDvJX3LgCtS46zauBdd47XqLu2XB0rjIZeHPW6E=; b=XM82ALAhIk87gn 4Wkm5TcQX8OkXry7r9PzVCa1ViDYgmhz/L1lMkCxfSQcjom/u+VTtGkbo0QBZJFtSfZR2GH41PZh9 mh39M2Z03ib+EXh6ekpsScn4FRSZoDTdpia76RE4/t4EL8RPf8fvMGg3HXNsAL4heAdcJdtxSJijf wmduYXvDlXZqof/S7z6G1+JzwFB3Mw3FlGIh4QC/hFTRmrudNC18K4ruTWhwoOJBDdYGF0lG9ZF3a 9vNFD4g0e3U/GIx5TR63szueafob4zMY6gN9Z2075gehoZwx+2+FN4z5Vy4Dn1TDOT8Xu7v4psnT6 n8zHMZLn+dwA8IDdEuvA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q8sUT-006X32-1w; Tue, 13 Jun 2023 01:06:33 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q8sUP-006X26-33 for linux-arm-kernel@lists.infradead.org; Tue, 13 Jun 2023 01:06:31 +0000 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 705C86298A; Tue, 13 Jun 2023 01:06:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CAE00C433EF; Tue, 13 Jun 2023 01:06:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686618388; bh=+zttTJLFniMHAb54GyKrL5R5BjLoU/2jNy216kjYbK4=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=Si94vaJe7VQDSSUiRD0BVoL1X4G2hCCtsvpFW4Yf1sEubDi24mmMrl/+U71nD5q0P M/GX7upUFdVph8EQ3oyp1Hiua+0mC1fXLCk/qnrVCa8pmuH6d9MMf47WjqTxoml8T1 3fMjREoXSd7XI81xZ86CdtUfF3LuemJbgm4yz5+GXE9H+iv5SUrGXaYlL3YzU+5fu3 vkxbnbNavNqjdv2uCxOAYq/NN/4EXwgsEDpRrckphWTKgHAArdhcpUqyMaw1p9TtSw qi434drqtnZbNZrP+MmYD54SIwZ7L/TvbDB3cUZi8j1o0hBL/rt20QcAbDT511zdVO gUy5cAdQGhY0A== Message-ID: <6f8ca3a44de72e21b16a85f65b001de4.sboyd@kernel.org> MIME-Version: 1.0 In-Reply-To: <202306101217.08CRVGcK-lkp@intel.com> References: <202306101217.08CRVGcK-lkp@intel.com> Subject: Re: [clk:clk-determine-rate 66/68] sound/soc/codecs/tlv320aic32x4-clk.c:219 clk_aic32x4_pll_determine_rate() warn: unsigned 'rate' is never less than zero. From: Stephen Boyd Cc: oe-kbuild-all@lists.linux.dev, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org To: Maxime Ripard , kernel test robot Date: Mon, 12 Jun 2023 18:06:26 -0700 User-Agent: alot/0.10 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230612_180630_074280_DCC386CD X-CRM114-Status: GOOD ( 14.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Quoting kernel test robot (2023-06-09 21:38:56) > tree: https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-determine-rate > head: 326cc42f9fdc3030676e949d5cea3ccc923fd1de > commit: 25d43ec352eaefbfaee0912d02b6f10ea606931f [66/68] ASoC: tlv320aic32x4: pll: Switch to determine_rate > config: x86_64-randconfig-m001-20230608 (https://download.01.org/0day-ci/archive/20230610/202306101217.08CRVGcK-lkp@intel.com/config) > compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 > > If you fix the issue in a separate patch/commit (i.e. not just a new version of > the same patch/commit), kindly add following tags > | Reported-by: kernel test robot > | Closes: https://lore.kernel.org/oe-kbuild-all/202306101217.08CRVGcK-lkp@intel.com/ > > smatch warnings: > sound/soc/codecs/tlv320aic32x4-clk.c:219 clk_aic32x4_pll_determine_rate() warn: unsigned 'rate' is never less than zero. > > vim +/rate +219 sound/soc/codecs/tlv320aic32x4-clk.c > > 206 > 207 static int clk_aic32x4_pll_determine_rate(struct clk_hw *hw, > 208 struct clk_rate_request *req) > 209 { > 210 struct clk_aic32x4_pll_muldiv settings; > 211 unsigned long rate; > 212 int ret; > 213 > 214 ret = clk_aic32x4_pll_calc_muldiv(&settings, req->rate, req->best_parent_rate); > 215 if (ret < 0) > 216 return -EINVAL; > 217 > 218 rate = clk_aic32x4_pll_calc_rate(&settings, req->best_parent_rate); > > 219 if (rate < 0) > 220 return rate; > 221 > 222 req->rate = rate; > 223 return 0; > 224 } > 225 Should we just apply this patch? ---8<--- diff --git a/sound/soc/codecs/tlv320aic32x4-clk.c b/sound/soc/codecs/tlv320aic32x4-clk.c index a7ec501b4c69..c116e82f712d 100644 --- a/sound/soc/codecs/tlv320aic32x4-clk.c +++ b/sound/soc/codecs/tlv320aic32x4-clk.c @@ -208,18 +208,14 @@ static int clk_aic32x4_pll_determine_rate(struct clk_hw *hw, struct clk_rate_request *req) { struct clk_aic32x4_pll_muldiv settings; - unsigned long rate; int ret; ret = clk_aic32x4_pll_calc_muldiv(&settings, req->rate, req->best_parent_rate); if (ret < 0) return -EINVAL; - rate = clk_aic32x4_pll_calc_rate(&settings, req->best_parent_rate); - if (rate < 0) - return rate; + req->rate = clk_aic32x4_pll_calc_rate(&settings, req->best_parent_rate); - req->rate = rate; return 0; } _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel