Linux clock framework development
 help / color / mirror / Atom feed
* [PATCH v2] clk: qcom: Constify qcom_cc_driver_data and list of critical CBCR registers
@ 2026-04-29 17:09 Krzysztof Kozlowski
  2026-04-29 17:14 ` Taniya Das
  2026-04-30 13:03 ` Vladimir Zapolskiy
  0 siblings, 2 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2026-04-29 17:09 UTC (permalink / raw)
  To: Bjorn Andersson, Michael Turquette, Stephen Boyd, linux-arm-msm,
	linux-clk, linux-kernel
  Cc: Krzysztof Kozlowski, Dmitry Baryshkov

The static 'struct qcom_cc_driver_data' and array 'xxx_critical_cbcrs'
are already treated by common.c code as pointers to const, so constify
few remaining pieces.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

---

Changes in v2:
1. Constify also nw_gcc_nord_critical_cbcrs (Sashiko)
2. Add rb tag
---
 drivers/clk/qcom/gcc-nord.c     | 2 +-
 drivers/clk/qcom/gpucc-sm8750.c | 4 ++--
 drivers/clk/qcom/negcc-nord.c   | 2 +-
 drivers/clk/qcom/nwgcc-nord.c   | 4 ++--
 drivers/clk/qcom/segcc-nord.c   | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/clk/qcom/gcc-nord.c b/drivers/clk/qcom/gcc-nord.c
index 3098d8fac0fb..8a6e429f2640 100644
--- a/drivers/clk/qcom/gcc-nord.c
+++ b/drivers/clk/qcom/gcc-nord.c
@@ -1850,7 +1850,7 @@ static const struct regmap_config gcc_nord_regmap_config = {
 	.fast_io = true,
 };
 
-static struct qcom_cc_driver_data gcc_nord_driver_data = {
+static const struct qcom_cc_driver_data gcc_nord_driver_data = {
 	.dfs_rcgs = gcc_nord_dfs_clocks,
 	.num_dfs_rcgs = ARRAY_SIZE(gcc_nord_dfs_clocks),
 };
diff --git a/drivers/clk/qcom/gpucc-sm8750.c b/drivers/clk/qcom/gpucc-sm8750.c
index 5d52c6d8b5e5..1466bd36403f 100644
--- a/drivers/clk/qcom/gpucc-sm8750.c
+++ b/drivers/clk/qcom/gpucc-sm8750.c
@@ -421,7 +421,7 @@ static struct clk_alpha_pll *gpu_cc_alpha_plls[] = {
 	&gpu_cc_pll0,
 };
 
-static u32 gpu_cc_sm8750_critical_cbcrs[] = {
+static const u32 gpu_cc_sm8750_critical_cbcrs[] = {
 	0x9004, /* GPU_CC_RSCC_XO_AON_CLK */
 	0x9008, /* GPU_CC_CXO_AON_CLK */
 	0x9064, /* GPU_CC_GX_AHB_FF_CLK */
@@ -430,7 +430,7 @@ static u32 gpu_cc_sm8750_critical_cbcrs[] = {
 	0x93a8, /* GPU_CC_RSCC_HUB_AON_CLK */
 };
 
-static struct qcom_cc_driver_data gpu_cc_sm8750_driver_data = {
+static const struct qcom_cc_driver_data gpu_cc_sm8750_driver_data = {
 	.alpha_plls = gpu_cc_alpha_plls,
 	.num_alpha_plls = ARRAY_SIZE(gpu_cc_alpha_plls),
 	.clk_cbcrs = gpu_cc_sm8750_critical_cbcrs,
diff --git a/drivers/clk/qcom/negcc-nord.c b/drivers/clk/qcom/negcc-nord.c
index 1aa24e2784e5..2cb66b0691a6 100644
--- a/drivers/clk/qcom/negcc-nord.c
+++ b/drivers/clk/qcom/negcc-nord.c
@@ -1945,7 +1945,7 @@ static void clk_nord_regs_configure(struct device *dev, struct regmap *regmap)
 	qcom_branch_set_force_mem_core(regmap, ne_gcc_ufs_phy_axi_clk, true);
 }
 
-static struct qcom_cc_driver_data ne_gcc_nord_driver_data = {
+static const struct qcom_cc_driver_data ne_gcc_nord_driver_data = {
 	.dfs_rcgs = ne_gcc_nord_dfs_clocks,
 	.num_dfs_rcgs = ARRAY_SIZE(ne_gcc_nord_dfs_clocks),
 	.clk_regs_configure = clk_nord_regs_configure,
diff --git a/drivers/clk/qcom/nwgcc-nord.c b/drivers/clk/qcom/nwgcc-nord.c
index 163ab63c872b..961cae47ff7c 100644
--- a/drivers/clk/qcom/nwgcc-nord.c
+++ b/drivers/clk/qcom/nwgcc-nord.c
@@ -626,7 +626,7 @@ static const struct qcom_reset_map nw_gcc_nord_resets[] = {
 	[NW_GCC_VIDEO_BCR] = { 0x1a000 },
 };
 
-static u32 nw_gcc_nord_critical_cbcrs[] = {
+static const u32 nw_gcc_nord_critical_cbcrs[] = {
 	0x16004, /* NW_GCC_CAMERA_AHB_CLK */
 	0x16030, /* NW_GCC_CAMERA_XO_CLK */
 	0x18004, /* NW_GCC_DISP_0_AHB_CLK */
@@ -641,7 +641,7 @@ static u32 nw_gcc_nord_critical_cbcrs[] = {
 	0x1a044, /* NW_GCC_VIDEO_XO_CLK */
 };
 
-static struct qcom_cc_driver_data nw_gcc_nord_driver_data = {
+static const struct qcom_cc_driver_data nw_gcc_nord_driver_data = {
 	.clk_cbcrs = nw_gcc_nord_critical_cbcrs,
 	.num_clk_cbcrs = ARRAY_SIZE(nw_gcc_nord_critical_cbcrs),
 };
diff --git a/drivers/clk/qcom/segcc-nord.c b/drivers/clk/qcom/segcc-nord.c
index 1aab0999de4d..c82a56d97154 100644
--- a/drivers/clk/qcom/segcc-nord.c
+++ b/drivers/clk/qcom/segcc-nord.c
@@ -1568,7 +1568,7 @@ static const struct regmap_config se_gcc_nord_regmap_config = {
 	.fast_io = true,
 };
 
-static struct qcom_cc_driver_data se_gcc_nord_driver_data = {
+static const struct qcom_cc_driver_data se_gcc_nord_driver_data = {
 	.dfs_rcgs = se_gcc_nord_dfs_clocks,
 	.num_dfs_rcgs = ARRAY_SIZE(se_gcc_nord_dfs_clocks),
 };
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] clk: qcom: Constify qcom_cc_driver_data and list of critical CBCR registers
  2026-04-29 17:09 [PATCH v2] clk: qcom: Constify qcom_cc_driver_data and list of critical CBCR registers Krzysztof Kozlowski
@ 2026-04-29 17:14 ` Taniya Das
  2026-04-30 13:03 ` Vladimir Zapolskiy
  1 sibling, 0 replies; 6+ messages in thread
From: Taniya Das @ 2026-04-29 17:14 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Bjorn Andersson, Michael Turquette,
	Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel
  Cc: Dmitry Baryshkov



On 4/29/2026 10:39 PM, Krzysztof Kozlowski wrote:
> The static 'struct qcom_cc_driver_data' and array 'xxx_critical_cbcrs'
> are already treated by common.c code as pointers to const, so constify
> few remaining pieces.
> 
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> 
> ---
> 
> Changes in v2:
> 1. Constify also nw_gcc_nord_critical_cbcrs (Sashiko)
> 2. Add rb tag
> ---
>  drivers/clk/qcom/gcc-nord.c     | 2 +-
>  drivers/clk/qcom/gpucc-sm8750.c | 4 ++--
>  drivers/clk/qcom/negcc-nord.c   | 2 +-
>  drivers/clk/qcom/nwgcc-nord.c   | 4 ++--
>  drivers/clk/qcom/segcc-nord.c   | 2 +-
>  5 files changed, 7 insertions(+), 7 deletions(-)

Reviewed-by: Taniya Das <taniya.das@oss.qualcomm.com>

-- 
Thanks,
Taniya Das


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] clk: qcom: Constify qcom_cc_driver_data and list of critical CBCR registers
  2026-04-29 17:09 [PATCH v2] clk: qcom: Constify qcom_cc_driver_data and list of critical CBCR registers Krzysztof Kozlowski
  2026-04-29 17:14 ` Taniya Das
@ 2026-04-30 13:03 ` Vladimir Zapolskiy
  2026-04-30 14:05   ` Krzysztof Kozlowski
  1 sibling, 1 reply; 6+ messages in thread
From: Vladimir Zapolskiy @ 2026-04-30 13:03 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Bjorn Andersson, Michael Turquette,
	Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel
  Cc: Dmitry Baryshkov

On 4/29/26 20:09, Krzysztof Kozlowski wrote:
> The static 'struct qcom_cc_driver_data' and array 'xxx_critical_cbcrs'
> are already treated by common.c code as pointers to const, so constify
> few remaining pieces.
> 
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> 
> ---
> 
> Changes in v2:
> 1. Constify also nw_gcc_nord_critical_cbcrs (Sashiko)
> 2. Add rb tag
> ---
>   drivers/clk/qcom/gcc-nord.c     | 2 +-
>   drivers/clk/qcom/gpucc-sm8750.c | 4 ++--
>   drivers/clk/qcom/negcc-nord.c   | 2 +-
>   drivers/clk/qcom/nwgcc-nord.c   | 4 ++--
>   drivers/clk/qcom/segcc-nord.c   | 2 +-
>   5 files changed, 7 insertions(+), 7 deletions(-)

What's about constifying video_cc_sm8550_driver_data from videocc-sm8550.c?

Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>

-- 
Best wishes,
Vladimir

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] clk: qcom: Constify qcom_cc_driver_data and list of critical CBCR registers
  2026-04-30 13:03 ` Vladimir Zapolskiy
@ 2026-04-30 14:05   ` Krzysztof Kozlowski
  2026-04-30 14:36     ` Vladimir Zapolskiy
  0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2026-04-30 14:05 UTC (permalink / raw)
  To: Vladimir Zapolskiy, Bjorn Andersson, Michael Turquette,
	Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel
  Cc: Dmitry Baryshkov

On 30/04/2026 15:03, Vladimir Zapolskiy wrote:
> On 4/29/26 20:09, Krzysztof Kozlowski wrote:
>> The static 'struct qcom_cc_driver_data' and array 'xxx_critical_cbcrs'
>> are already treated by common.c code as pointers to const, so constify
>> few remaining pieces.
>>
>> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
>>
>> ---
>>
>> Changes in v2:
>> 1. Constify also nw_gcc_nord_critical_cbcrs (Sashiko)
>> 2. Add rb tag
>> ---
>>   drivers/clk/qcom/gcc-nord.c     | 2 +-
>>   drivers/clk/qcom/gpucc-sm8750.c | 4 ++--
>>   drivers/clk/qcom/negcc-nord.c   | 2 +-
>>   drivers/clk/qcom/nwgcc-nord.c   | 4 ++--
>>   drivers/clk/qcom/segcc-nord.c   | 2 +-
>>   5 files changed, 7 insertions(+), 7 deletions(-)
> 
> What's about constifying video_cc_sm8550_driver_data from videocc-sm8550.c?


It's on my exception list, not sure what would be the benefit in practice.


Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] clk: qcom: Constify qcom_cc_driver_data and list of critical CBCR registers
  2026-04-30 14:05   ` Krzysztof Kozlowski
@ 2026-04-30 14:36     ` Vladimir Zapolskiy
  2026-04-30 14:43       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 6+ messages in thread
From: Vladimir Zapolskiy @ 2026-04-30 14:36 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Bjorn Andersson, Michael Turquette,
	Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel
  Cc: Dmitry Baryshkov

On 4/30/26 17:05, Krzysztof Kozlowski wrote:
> On 30/04/2026 15:03, Vladimir Zapolskiy wrote:
>> On 4/29/26 20:09, Krzysztof Kozlowski wrote:
>>> The static 'struct qcom_cc_driver_data' and array 'xxx_critical_cbcrs'
>>> are already treated by common.c code as pointers to const, so constify
>>> few remaining pieces.
>>>
>>> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
>>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
>>>
>>> ---
>>>
>>> Changes in v2:
>>> 1. Constify also nw_gcc_nord_critical_cbcrs (Sashiko)
>>> 2. Add rb tag
>>> ---
>>>    drivers/clk/qcom/gcc-nord.c     | 2 +-
>>>    drivers/clk/qcom/gpucc-sm8750.c | 4 ++--
>>>    drivers/clk/qcom/negcc-nord.c   | 2 +-
>>>    drivers/clk/qcom/nwgcc-nord.c   | 4 ++--
>>>    drivers/clk/qcom/segcc-nord.c   | 2 +-
>>>    5 files changed, 7 insertions(+), 7 deletions(-)
>>
>> What's about constifying video_cc_sm8550_driver_data from videocc-sm8550.c?
> 
> 
> It's on my exception list, not sure what would be the benefit in practice.
> 

The benefit is just the same as the one described in the commit message,
having such a peculiar exception left makes the commit message statement
"constify few remaining pieces" imprecise, and if it's done deliberately,
then it should be explained why it's done so in the commit message.

-- 
Best wishes,
Vladimir

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] clk: qcom: Constify qcom_cc_driver_data and list of critical CBCR registers
  2026-04-30 14:36     ` Vladimir Zapolskiy
@ 2026-04-30 14:43       ` Krzysztof Kozlowski
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2026-04-30 14:43 UTC (permalink / raw)
  To: Vladimir Zapolskiy, Bjorn Andersson, Michael Turquette,
	Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel
  Cc: Dmitry Baryshkov

On 30/04/2026 16:36, Vladimir Zapolskiy wrote:
> On 4/30/26 17:05, Krzysztof Kozlowski wrote:
>> On 30/04/2026 15:03, Vladimir Zapolskiy wrote:
>>> On 4/29/26 20:09, Krzysztof Kozlowski wrote:
>>>> The static 'struct qcom_cc_driver_data' and array 'xxx_critical_cbcrs'
>>>> are already treated by common.c code as pointers to const, so constify
>>>> few remaining pieces.
>>>>
>>>> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
>>>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
>>>>
>>>> ---
>>>>
>>>> Changes in v2:
>>>> 1. Constify also nw_gcc_nord_critical_cbcrs (Sashiko)
>>>> 2. Add rb tag
>>>> ---
>>>>    drivers/clk/qcom/gcc-nord.c     | 2 +-
>>>>    drivers/clk/qcom/gpucc-sm8750.c | 4 ++--
>>>>    drivers/clk/qcom/negcc-nord.c   | 2 +-
>>>>    drivers/clk/qcom/nwgcc-nord.c   | 4 ++--
>>>>    drivers/clk/qcom/segcc-nord.c   | 2 +-
>>>>    5 files changed, 7 insertions(+), 7 deletions(-)
>>>
>>> What's about constifying video_cc_sm8550_driver_data from videocc-sm8550.c?
>>
>>
>> It's on my exception list, not sure what would be the benefit in practice.
>>
> 
> The benefit is just the same as the one described in the commit message,
> having such a peculiar exception left makes the commit message statement
> "constify few remaining pieces" imprecise, and if it's done deliberately,
> then it should be explained why it's done so in the commit message.


What do you mean? The code is obvious that it cannot be done. We do not
have to explain absolutely obvious C code.


Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-04-30 14:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-29 17:09 [PATCH v2] clk: qcom: Constify qcom_cc_driver_data and list of critical CBCR registers Krzysztof Kozlowski
2026-04-29 17:14 ` Taniya Das
2026-04-30 13:03 ` Vladimir Zapolskiy
2026-04-30 14:05   ` Krzysztof Kozlowski
2026-04-30 14:36     ` Vladimir Zapolskiy
2026-04-30 14:43       ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox