Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp355923rdf; Tue, 21 Nov 2023 04:55:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IGwuqqLDjv+C63g6rZdUKABjojk7Dk65rC9MgtVDxU+OAqJIu2V0tOkYrV0iY1LmmOaBkuO X-Received: by 2002:a17:902:6a8c:b0:1cf:5362:7e79 with SMTP id n12-20020a1709026a8c00b001cf53627e79mr10230539plk.20.1700571306031; Tue, 21 Nov 2023 04:55:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700571306; cv=none; d=google.com; s=arc-20160816; b=NNSSmXxbItlzoKZpirQB9YQMrvenak4t2bF3zjGqOn5sWEMuM5GsXOD5T+bQoiFalb RhLXfNt+/hPih6viyk9y/zlw3gNuWEEvUg7JkySnSHT/cBw/HD0smVxtFnH3LYRE2SSs LBp0yoZu5eqNgp0Ow/d3eq08LkKBdnEbtmzoPRHO5J4KVYxsOdsM8/mZJuONhsIQFZ0k 1IHonFju48gUhCP3hY1dECLxPt1eJhH0cedyBVbruRoCIKCE+LojAmwswpmZchFyRCH3 J8JLuIIa4c9oy5W48EY2Q8UP3S+15LrPYmUYrf+VvDqZux0EV1dmELdgN+A8wGJQQeW8 w4sQ== 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=bshaVLl7I5VmG/9PhcP3nuXBjaqS8pv5wJ1Ry067DEY=; fh=m5p6pcg3y47Sg5VKYWXj0f0nOzgFq4l5+GGYwGce+t4=; b=sGH1N0SOdNJiGGJKu0ajy7T5cSee4NhWP/d+gFoxhum+VsEBTo/Ncupz0M4Dqe+/FT 5kSvlG3nVc0u4K6hIF1lTXCsRR3IifWBQDtH0rZLDJbRTsorU7sYhXHnzfRrNVIRb8lh XYNGUF+YDN+WZ3lPWTMmAt57b+scjFqUueQVKLRaQ6P/vICst9xzt26U2ibOLSSLot+c JNn9C+f0l09Df2knw+C1hXZbR7xfOj8a6lCyrq9BnjamWsHCi9C4WHK0qJ1XxAY2j4ik bGemno4ddOLxRJqxlAOfzhNSm/hfYPf3o6YludQ4LGuvb+f9vkSRXToDPGzrbx/sbGok pYvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=ViAFubID; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id u7-20020a17090341c700b001cf576043fbsi6691874ple.575.2023.11.21.04.55.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 04:55:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=ViAFubID; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 3EC98803E7B1; Tue, 21 Nov 2023 04:52:15 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234229AbjKUMvu (ORCPT + 99 others); Tue, 21 Nov 2023 07:51:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233952AbjKUMvS (ORCPT ); Tue, 21 Nov 2023 07:51:18 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 731B910F8; Tue, 21 Nov 2023 04:51:10 -0800 (PST) Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 1F8F06607314; Tue, 21 Nov 2023 12:51:08 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1700571068; bh=P8X/98SRN6b58tyqRku7rqXinlOozOu5V7sRiK56qy0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ViAFubIDMIpRtDAs9VWbbuSobDzYbrb4oaI/Ozqt8FOV9mv26AuDFXqM2mK76IOUU Fu3pX8d5NKnDZkEN4nznxEyaVdLsReuQb5nL3EMQK6ua+KTLTx8ogveZSrurl2ZfRH 3AUh77aff/E/s4EV+w+LctagcInvhCO1tXtoi/kDJZmz/nzOFtDC4HuFX5wifFQ1DL O5OjPmGgpW8CIRjWkypSvvG7iNrxMFPk/N8PHbGIFZlgTrUpY1PVoX2sjnyFopseer dzDCi/84ynhKL4KUxeXk/P79MorKHZVOPieQexYcwlXL2h2ps59R3JDcPi11imLHKI +wbaCV2Kn2Wig== From: AngeloGioacchino Del Regno To: matthias.bgg@gmail.com Cc: krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, robh+dt@kernel.org, angelogioacchino.delregno@collabora.com, p.zabel@pengutronix.de, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@collabora.com, wenst@chromium.org Subject: [PATCH v3 17/20] soc: mediatek: mtk-svs: Use ULONG_MAX to compare floor frequency Date: Tue, 21 Nov 2023 13:50:41 +0100 Message-ID: <20231121125044.78642-18-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231121125044.78642-1-angelogioacchino.delregno@collabora.com> References: <20231121125044.78642-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 21 Nov 2023 04:52:15 -0800 (PST) The `freq` variable is of type unsigned long and, even though it does currently work with u32 because no frequency is higher than U32_MAX, it is not guaranteed that in the future we will see one. Initialize the freq variable with ULONG_MAX instead of U32_MAX. Signed-off-by: AngeloGioacchino Del Regno --- drivers/soc/mediatek/mtk-svs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c index 16a16c5a3f24..df39e7430ba9 100644 --- a/drivers/soc/mediatek/mtk-svs.c +++ b/drivers/soc/mediatek/mtk-svs.c @@ -1804,7 +1804,7 @@ static int svs_bank_resource_setup(struct svs_platform *svsp) return count; } - for (i = 0, freq = U32_MAX; i < svsb->opp_count; i++, freq--) { + for (i = 0, freq = ULONG_MAX; i < svsb->opp_count; i++, freq--) { opp = dev_pm_opp_find_freq_floor(svsb->opp_dev, &freq); if (IS_ERR(opp)) { dev_err(svsb->dev, "cannot find freq = %ld\n", -- 2.42.0