Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp395320rdb; Fri, 17 Nov 2023 01:45:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IG9Vl+8OpPEKxiuY2bazS9d4VFRhcxM46pyadUQsi6mBIj0ojPB4JHfvLncq2ApwdEol+d1 X-Received: by 2002:a05:6e02:19c7:b0:359:d340:44f3 with SMTP id r7-20020a056e0219c700b00359d34044f3mr24783800ill.15.1700214341358; Fri, 17 Nov 2023 01:45:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700214341; cv=none; d=google.com; s=arc-20160816; b=Bm3TRC44bzC79uAZOaP9K19+77XO/Xs+XY7IYjkdf7jkX16tVK59gxJPS6EO/MiFVo FRrXd+Zc8xoeXziztSPlN4PlruaWQuk0ul/Sj6fUADEBoeZmJWV4re8WZYGG7UHVeCVy tMIw0BjnMrrQWc6WuEeD1QAqQKKPoEVrtPORezG6UqweRAoFgejqXbCBICqjFDuym9LI X5f704jvc03C+C7QlR0xRPKTy7Q5NR8ngJvCCHn2bB9kqD+RMoooujdPN0eij/xb6op4 498mU3Ir2mlA6uR6zqWNINz2FyP9Mnp5BLWwfvUCusvy/7ZhBxYEjRYrcm4gxBVTlGzk TK8w== 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=CAtwZpQQ9dDzVAF8MOHAYbnbSpeAVL++pdIJqWphVmPMTieN+SRGDLAduCByKQYkDU XMIJKHVqOk7Alp/6UF+MgiedYv1O7lxGGRA1l2ZTpwjEnf4wrR+0btWf5lWQmZD0Okgk zJ0teVMRUjjGnr2yzLvOr7gH4qEeTS2FGgKcGOKtNvg3BaYglIuwH6gH3SCWtcyLcgiU za+7ai3VLRdaw5UIq/l8fZtOD8Oc9v+uGhra3DPYoX9r7nqpiglaH/Dgw+I3ninpcCvi OWTN8uHbwvC9qk18a3HHpoZD8pn9rpCWwm4ok0QcyNfrHJqA/jjk7Ob5Y1bTL/yyztE+ IsDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=F5IXmwIy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id b124-20020a62cf82000000b006c31254aadbsi397981pfg.90.2023.11.17.01.45.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 01:45:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=F5IXmwIy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 2A88381D2D3C; Fri, 17 Nov 2023 01:45:33 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345815AbjKQJnu (ORCPT + 99 others); Fri, 17 Nov 2023 04:43:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345784AbjKQJnV (ORCPT ); Fri, 17 Nov 2023 04:43:21 -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 2A787199D; Fri, 17 Nov 2023 01:42:53 -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 27FDE6607390; Fri, 17 Nov 2023 09:42:51 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1700214172; bh=P8X/98SRN6b58tyqRku7rqXinlOozOu5V7sRiK56qy0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F5IXmwIy38/fn23gDLxutrx/u8ezb9RKv66d3sxgwtwtqHzmo5NVoIKEFJvkwXZoc FqNAkMqP5dhJBy04ctNGA9n6ZOiqEuw1KsuImURIMDXVzpt+SXtnum1z19F7n5TWTb /GczntLx6lys/5PZ5802zi+qaWDgsb63dQHBQCfgsop9E+nKjH1Le7mkg4MyOZhNpB f7LNImqXvXJL17GXLDDAXs2jrV/NPq8OFTvQ2UlKJ9PloDib+PwcP8esUHpWWzkzfy dGTFjbgQ36BeuOramFMBJEcFqG0+xK5L3Uvxrj6uoNLgFI7aZyYEEhJVyHQ42TZK1t 8UnQ4cH+2eJuA== 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 v1 17/20] soc: mediatek: mtk-svs: Use ULONG_MAX to compare floor frequency Date: Fri, 17 Nov 2023 10:42:25 +0100 Message-ID: <20231117094228.40013-18-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231117094228.40013-1-angelogioacchino.delregno@collabora.com> References: <20231117094228.40013-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Fri, 17 Nov 2023 01:45:33 -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