Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp323199rdf; Tue, 21 Nov 2023 04:00:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IEfYdneYfI4YNiNHd84wGJGE5vsD3RHlR9TurZvK5ThpCKqCXn9Av9zI5Ozzh613tVjbqrl X-Received: by 2002:a05:6830:1552:b0:6d3:efe:f2a5 with SMTP id l18-20020a056830155200b006d30efef2a5mr11656607otp.9.1700568009434; Tue, 21 Nov 2023 04:00:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700568009; cv=none; d=google.com; s=arc-20160816; b=j2crS0N/hBNjSD2fBWzXMoazXd2kTWeG4oaRxTBKNFiIRVqMMVQC3HOv79KtP4eda0 qZ85A9uJZclF9ed8rA69AgaNBNuJftU1y7zXt1CWOjJgif2zhEfzguq1xoaP+7Bua7NH WM8tnh2gqPQSgsR941Oz970yyd6E9DsAYUh1E6KnO9SmDMtiVs2POQsWka8Hbnoybvzm 3dXUZPS7RPf44qSxd3U2zRtk3EQeg11hEkK+vt6HQ+BY+5YU2rdVrDqQ0DRSFJu5SJSX A/s8pNZhlq1mam0KjNa9NTeEoPdDsDcd0kMC7Uq67pIbqCE6emvuq4e9WL3OpdJupQhS 5l+Q== 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=xBU+M6qv5DOOcZVg14bH2gTrlYEmh8HyRg9c3rAgKvIqFOlUPW0zTNO/zsok45Jtks xCo2JjW+fZ6QEGr/kM31koIfdxx4DQz/F0iayQtUw7t/w+Rtb++gE2crqHz5UZxo9Ba8 fADc3p78QX7GQjuorKhBlqAzKX4NJICRt/1tfEZvTqNuhdDzjmXVx+QGlf/1K6gnavkz oag9FnOw1DV4UTaooaNLTRlNGHKs4my2M8eoEvvsTfd2s799ZkelKSgCAJ6wBjbxu+RV BZccAbQ7sVPpCcqNvXgmOIJn9/K+9GW2GsPfCaCmZQP1YOi17TRoWZczDqoVg9G0jF5G APXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=dHgS1RJq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id t187-20020a632dc4000000b005bdfb8a9048si10467844pgt.67.2023.11.21.04.00.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 04:00:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=dHgS1RJq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 993B281121F6; Tue, 21 Nov 2023 03:58:18 -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 S234730AbjKUL6E (ORCPT + 99 others); Tue, 21 Nov 2023 06:58:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234616AbjKUL4y (ORCPT ); Tue, 21 Nov 2023 06:56:54 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F29713D; Tue, 21 Nov 2023 03:56:50 -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 8D74B6607326; Tue, 21 Nov 2023 11:56:48 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1700567809; bh=P8X/98SRN6b58tyqRku7rqXinlOozOu5V7sRiK56qy0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dHgS1RJq0Qde42IELsuCTHqSQUUMs2O5o3pr6jsaRfeWgucPLnjDnNFC+734Mq2l8 ev3lxVepD9nZeneSZtjzM9cCNvo0vLgJh5rTGhiRsh/Aq1XNMzckz1syPTnrmkvOeN badIDZ0WLaQGPbm9sRVl+I3MSUE/LrPj14tQEQOccy6XJqFy8x3KQW0RAaMX9uwumR OGX/i75TqF4MZ8mlRJrzvgpeVRXxowj0odh5PX8/dK85bg6ds3rLu47pz12MGAV9a9 WWpEf6mwTIHCnv3Y4fXFfUmJz6iQlnQH1reXh2BtjImAQiFaxF7DnCTU8bIrmoCw2R tICxMBVJU6E+Q== 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 v2 17/20] soc: mediatek: mtk-svs: Use ULONG_MAX to compare floor frequency Date: Tue, 21 Nov 2023 12:56:21 +0100 Message-ID: <20231121115624.56855-18-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231121115624.56855-1-angelogioacchino.delregno@collabora.com> References: <20231121115624.56855-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,RCVD_IN_DNSWL_BLOCKED, 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 03:58:18 -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