From patchwork Mon Sep 9 13:51:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797145 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 5B429ECE579 for ; Mon, 9 Sep 2024 14:02:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2Ca+bwI9Pu7F3YUoAaUsqSsRV8VpFvNoCThNciak41Q=; b=wSA+1h8OyWppjGvpCJC4fKXF4j q6V8LuHC4PKaiFlzCBvsWPuBujBPefo+icUL5I088LLVfe3yCzI/F3OD3WfNIGAlbiyLt9a8Lh2Fj g9DX3lbZf5eXTp0t4+TZa+ZJMfI6kMcl90dGQHklVdSQwCgH7h46PoxEf1JL0/gTdEcwJTOfqCjZk 3lrj4ZR4I6frOr//XH72uCjLK0FsmE0HFZxoNPCPTC2kE/nx1NWJPgfFaQiml3zhx8YqV6JR0joF/ P8lZOnNYv2WT2zQ1tDbp0T3RO0lggsKM8/Wa9o6oIPn2fA5lBMuLRjMMxefDgNoNLc9GfwlYSnBXy lqMBoqEg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sneyY-00000002Byf-1hFc; Mon, 09 Sep 2024 14:02:42 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sneoB-000000028kW-1wpf for linux-arm-kernel@bombadil.infradead.org; Mon, 09 Sep 2024 13:51:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=2Ca+bwI9Pu7F3YUoAaUsqSsRV8VpFvNoCThNciak41Q=; b=VjC/OwnYssyvFfWQyoZHBbuiYD HiWQqRo77OnhgzSrx3N2DOxfxbTOuzaxwrJriD26UmBDJHLIExjcwErUR3Gl36x+++esKr7ctR4wf K+oCpeO9KNeb1FgQfRQXQmIlLmStovFyIphsOvsA1GAtRoWebbsqLNEuSLZJhimszSmpFrmTK9v14 irRUNEJld9dl2Gk4dyqDaQRzbfECkdojk06T+JRihizKxQrwRYxLHnLMpKkYF4sjHc5o/ENKTQ7CB 6/AS1Gjq98wohxzH89Sk3uG9MtwOZygz4kFoY+zHI//EzpgS+YKue3qa14GqSD8QxZsBUZR8rjAG4 T1ls2TaA==; Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by desiato.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sneo8-00000000Ree-1sPD for linux-arm-kernel@lists.infradead.org; Mon, 09 Sep 2024 13:51:58 +0000 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-42cb198f23fso2612075e9.1 for ; Mon, 09 Sep 2024 06:51:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725889914; x=1726494714; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=2Ca+bwI9Pu7F3YUoAaUsqSsRV8VpFvNoCThNciak41Q=; b=StCt5cXjmNoG1x66ABoUGefZ/XcKjqSZiWxSPAyQ/yB/lw/X9rKVPMWG+CyI1XGcZg tTUzc17SELTjXUZaoKp7RorvPPTwNNFIbDWV5b6pfbJAAlw5BJjjmDzoM7lCcOfET7nq GhyN0ajWo1baEEcdFYeY6fgrTfemUWoz5HAi5uofE5wm09ccPvaSCNoWAPj5HpSWTDim OJ1Zok/gGQSKHuSnF+D5K/F8SuzZK3MV1FO4wX3o/OradXCi5YzYeU3OhFjSHnxcnpGS I4YtMmHcrJiT+e85bgw4VqWLBoQUcWRdgrwoiWlz0H7wf3S/7937mSsEB4DftSbV4ulz HjUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725889914; x=1726494714; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2Ca+bwI9Pu7F3YUoAaUsqSsRV8VpFvNoCThNciak41Q=; b=f6K+z6uAtljxmrD/RiN6+T6jWILEH7kfsf8Q5pFTSuBjNTP/6UIHBHEP3FbMRHruhZ Kv7ZvF1RKLH7l5qrq/2q1gHIAEZ5v6/K7pBPjSYPhzTAEO3W528IhesAh+4MUijHbrtG mpVWUuT9p0VMiSJXz8MjpJEunw+QNnzddKnomJo7t+0dUEVqEHfNtDESLl0Y0dziIW3z uUt4bNkLPXxR9hCa0AkoPhqi0lkV3x9761L9A0GnUPdSNbBrwjHeAHzABl3YUD4vxt+H F9AfSTvQmtsoYyWC226aLel3/j+vOH9sJ8UjBhjR/CQp8Cc0CPMZd0keC8twv9qRfjhL Iuog== X-Forwarded-Encrypted: i=1; AJvYcCUO9kmNrBq8dluv46kFMViGKru+//Z5dn2mTqwWFgo+BceLU/H2WjgA4+GmgOUcLpTTAhB/P4v8YYbu1/tkN/mx@lists.infradead.org X-Gm-Message-State: AOJu0YxoWFU6kO5hPYpV3wraqeDtoH0xMpaJyzOhU25ldvXie3y6y00A GpSnLlmTObKfN64c9T8czIxAwyxCpkjGRidfYKQknOPl8ZZT9/y5MX75xGZhypI= X-Google-Smtp-Source: AGHT+IHwSOk/fpUD97Xcan+P+CIOyJe34rmyJqYvmDhNziRzvW/wcrZnoC+6JMIT/uTXpLghlRozEQ== X-Received: by 2002:a05:6000:18a5:b0:378:955f:d242 with SMTP id ffacd0b85a97d-378955fd30emr2248356f8f.12.1725889913898; Mon, 09 Sep 2024 06:51:53 -0700 (PDT) Received: from [127.0.1.1] ([178.197.222.82]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25cf3ad6sm345344566b.148.2024.09.09.06.51.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 06:51:53 -0700 (PDT) From: Krzysztof Kozlowski Date: Mon, 09 Sep 2024 15:51:22 +0200 Subject: [PATCH 11/17] regulator: mtk-dvfsrc: Constify static data MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-11-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2139; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=zfZGJPZ+7n/u+R7h1aiFdsdkEzudbMyrWwt0mCMNVy8=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1iyrWzON70Cq7VuXn8aYsCpNlvo+gCyF8zr /RcPqSw97WJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79YgAKCRDBN2bmhouD 1yTND/9Kx2lZ3eCZZI46T755Vu5pa+AVNHwPIjhtgawTn9QLWZU4dx/nKarepxpIrJmJoAiNmef l9zUCIQ7tTRLh08J5eaODQJjDqqHS9iKGibJ1szkjME/jAk8tK2AuujylmN7rFF6OnjGZRy1hIX +MEkXzQnCsG3sWC79oLxmePYDAS9w79DyLnc+Y2VG416EUBy0sWemV843d/iP/ImkgfSQ8Z+rF0 NqNl+VSGgnBY0WeVjDR5J/LugNaoWcKIOo9oL0JPMMyqLCIbAyXKnZNOKH1RgJohboAaKvvRWcj pvqFAWqbP+cDOVyuibuNXPW57C0G9xz0AdR5CEvDaxMCzVsog/Mp3P+IPNH0DsLfNaLxMcub5pO 7uG43TuDc8R7IV6+0Kwgq6NsaOT+kBsDFBWodE0Kh2TzOv2uZ2COlbSO4fhWQ4xD+D4oOwxNtVa tkUbOckx0oRsGIXgLDv4DqJxJrzypzsLm12PnHbgKcTSps9z5zMpn193f6UCX6fJO9G6V5/GbFg sqWqNLxaDkdNgDua3Pl4lXKyL+90l4ssXiY9uwL788ThSvGGxE4eazeXMUmZ54lNbDvsDYJVzVj ozpmtPHcblf+kCN45ItBbo+Di94pYfYELDshUwux8NWiV61d+WNWYfAV21pMl+w6F26s8fo25Qh ymgij+ek/OQx8QQ== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240909_145156_624296_A5298457 X-CRM114-Status: GOOD ( 15.28 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Driver does not modify static data with regulator description (struct regulator_desc), so make it const for code safety. Signed-off-by: Krzysztof Kozlowski --- Have in mind that to compile this code, you need pending (off-tree) patches, which I applied. --- drivers/regulator/mtk-dvfsrc-regulator.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/regulator/mtk-dvfsrc-regulator.c b/drivers/regulator/mtk-dvfsrc-regulator.c index 9bf4163221f1..f5662c569464 100644 --- a/drivers/regulator/mtk-dvfsrc-regulator.c +++ b/drivers/regulator/mtk-dvfsrc-regulator.c @@ -19,7 +19,7 @@ enum dvfsrc_regulator_id { }; struct dvfsrc_regulator_pdata { - struct regulator_desc *descs; + const struct regulator_desc *descs; u32 size; }; @@ -107,7 +107,7 @@ static const unsigned int mt6873_voltages[] = { 725000, }; -static struct regulator_desc mt6873_regulators[] = { +static const struct regulator_desc mt6873_regulators[] = { MTK_DVFSRC_VREG("dvfsrc-vcore", VCORE, mt6873_voltages), MTK_DVFSRC_VREG("dvfsrc-vscp", VSCP, mt6873_voltages), }; @@ -122,7 +122,7 @@ static const unsigned int mt8183_voltages[] = { 800000, }; -static struct regulator_desc mt8183_regulators[] = { +static const struct regulator_desc mt8183_regulators[] = { MTK_DVFSRC_VREG("dvfsrc-vcore", VCORE, mt8183_voltages), }; @@ -138,7 +138,7 @@ static const unsigned int mt8195_voltages[] = { 750000, }; -static struct regulator_desc mt8195_regulators[] = { +static const struct regulator_desc mt8195_regulators[] = { MTK_DVFSRC_VREG("dvfsrc-vcore", VCORE, mt8195_voltages), MTK_DVFSRC_VREG("dvfsrc-vscp", VSCP, mt8195_voltages), }; @@ -159,7 +159,7 @@ static int dvfsrc_vcore_regulator_probe(struct platform_device *pdev) return -EINVAL; for (i = 0; i < pdata->size; i++) { - struct regulator_desc *vrdesc = &pdata->descs[i]; + const struct regulator_desc *vrdesc = &pdata->descs[i]; struct regulator_dev *rdev; rdev = devm_regulator_register(&pdev->dev, vrdesc, &config);