[PATCH v2 2/8] pmdomain: de-constify fields struct dev_pm_domain_attach_data

Dmitry Baryshkov posted 8 patches 1 week, 1 day ago
There is a newer version of this series
[PATCH v2 2/8] pmdomain: de-constify fields struct dev_pm_domain_attach_data
Posted by Dmitry Baryshkov 1 week, 1 day ago
It doesn't really make sense to keep u32 fields to be marked as const.
Having the const fields prevents their modification in the driver.
Instead the whole struct can be defined as const (if it is constant).

Fixes: 161e16a5e50a ("PM: domains: Add helper functions to attach/detach multiple PM domains")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
 include/linux/pm_domain.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index f6f6d494f728..b299dc0128d6 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -49,8 +49,8 @@
 
 struct dev_pm_domain_attach_data {
 	const char * const *pd_names;
-	const u32 num_pd_names;
-	const u32 pd_flags;
+	u32 num_pd_names;
+	u32 pd_flags;
 };
 
 struct dev_pm_domain_list {

-- 
2.47.3
Re: [PATCH v2 2/8] pmdomain: de-constify fields struct dev_pm_domain_attach_data
Posted by Bryan O'Donoghue 5 days, 18 hours ago
On 01/02/2026 10:48, Dmitry Baryshkov wrote:
> It doesn't really make sense to keep u32 fields to be marked as const.
> Having the const fields prevents their modification in the driver.
> Instead the whole struct can be defined as const (if it is constant).
> 
> Fixes: 161e16a5e50a ("PM: domains: Add helper functions to attach/detach multiple PM domains")

This doesn't really fix a bug though.

> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---
>   include/linux/pm_domain.h | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
> index f6f6d494f728..b299dc0128d6 100644
> --- a/include/linux/pm_domain.h
> +++ b/include/linux/pm_domain.h
> @@ -49,8 +49,8 @@
> 
>   struct dev_pm_domain_attach_data {
>   	const char * const *pd_names;
> -	const u32 num_pd_names;
> -	const u32 pd_flags;
> +	u32 num_pd_names;
> +	u32 pd_flags;
>   };
> 
>   struct dev_pm_domain_list {
> 
> --
> 2.47.3
> 
> 

Other than that.

Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>