diff mbox series

PM / Domains: replace -ENOTSUPP with -EOPNOTSUPP

Message ID 20201106164903.3906-1-ilina@codeaurora.org
State Superseded
Headers show
Series PM / Domains: replace -ENOTSUPP with -EOPNOTSUPP | expand

Commit Message

Lina Iyer Nov. 6, 2020, 4:49 p.m. UTC
While submitting a patch to add next_wakeup, checkpatch reported this -

WARNING: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP
+       return -ENOTSUPP;

Address the above warning in other functions in pm_domain.h.

Signed-off-by: Lina Iyer <ilina@codeaurora.org>
---
 include/linux/pm_domain.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Comments

Ulf Hansson Nov. 9, 2020, 11:39 a.m. UTC | #1
On Fri, 6 Nov 2020 at 17:49, Lina Iyer <ilina@codeaurora.org> wrote:
>
> While submitting a patch to add next_wakeup, checkpatch reported this -
>
> WARNING: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP
> +       return -ENOTSUPP;
>
> Address the above warning in other functions in pm_domain.h.
>
> Signed-off-by: Lina Iyer <ilina@codeaurora.org>

I assume you have looked at callers of these functions too, to make
sure they don't explicitly look at -ENOTSUPP?

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe

> ---
>  include/linux/pm_domain.h | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
> index 49982cd58bfd..e390388e6c17 100644
> --- a/include/linux/pm_domain.h
> +++ b/include/linux/pm_domain.h
> @@ -259,24 +259,24 @@ static inline int pm_genpd_init(struct generic_pm_domain *genpd,
>  }
>  static inline int pm_genpd_remove(struct generic_pm_domain *genpd)
>  {
> -       return -ENOTSUPP;
> +       return -EOPNOTSUPP;
>  }
>
>  static inline int dev_pm_genpd_set_performance_state(struct device *dev,
>                                                      unsigned int state)
>  {
> -       return -ENOTSUPP;
> +       return -EOPNOTSUPP;
>  }
>
>  static inline int dev_pm_genpd_add_notifier(struct device *dev,
>                                             struct notifier_block *nb)
>  {
> -       return -ENOTSUPP;
> +       return -EOPNOTSUPP;
>  }
>
>  static inline int dev_pm_genpd_remove_notifier(struct device *dev)
>  {
> -       return -ENOTSUPP;
> +       return -EOPNOTSUPP;
>  }
>
>  static inline int dev_pm_genpd_set_next_wakeup(struct device *dev, ktime_t next)
> @@ -334,13 +334,13 @@ struct device *genpd_dev_pm_attach_by_name(struct device *dev,
>  static inline int of_genpd_add_provider_simple(struct device_node *np,
>                                         struct generic_pm_domain *genpd)
>  {
> -       return -ENOTSUPP;
> +       return -EOPNOTSUPP;
>  }
>
>  static inline int of_genpd_add_provider_onecell(struct device_node *np,
>                                         struct genpd_onecell_data *data)
>  {
> -       return -ENOTSUPP;
> +       return -EOPNOTSUPP;
>  }
>
>  static inline void of_genpd_del_provider(struct device_node *np) {}
> @@ -396,7 +396,7 @@ static inline struct device *genpd_dev_pm_attach_by_name(struct device *dev,
>  static inline
>  struct generic_pm_domain *of_genpd_remove_last(struct device_node *np)
>  {
> -       return ERR_PTR(-ENOTSUPP);
> +       return ERR_PTR(-EOPNOTSUPP);
>  }
>  #endif /* CONFIG_PM_GENERIC_DOMAINS_OF */
>
> --
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
>
Lina Iyer Nov. 9, 2020, 3:24 p.m. UTC | #2
On Mon, Nov 09 2020 at 04:40 -0700, Ulf Hansson wrote:
>On Fri, 6 Nov 2020 at 17:49, Lina Iyer <ilina@codeaurora.org> wrote:
>>
>> While submitting a patch to add next_wakeup, checkpatch reported this -
>>
>> WARNING: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP
>> +       return -ENOTSUPP;
>>
>> Address the above warning in other functions in pm_domain.h.
>>
>> Signed-off-by: Lina Iyer <ilina@codeaurora.org>
>
>I assume you have looked at callers of these functions too, to make
>sure they don't explicitly look at -ENOTSUPP?
>
Yes, the first level callers at least. Most of them seem to return from
probe calls etc. Is there a nice way to make sure the second level
functions and the callers of those are not using -ENOTSUPP return from
these functions.

>Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
>
Thanks.

-- Lina

>Kind regards
>Uffe
>
>> ---
>>  include/linux/pm_domain.h | 14 +++++++-------
>>  1 file changed, 7 insertions(+), 7 deletions(-)
>>
>> diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
>> index 49982cd58bfd..e390388e6c17 100644
>> --- a/include/linux/pm_domain.h
>> +++ b/include/linux/pm_domain.h
>> @@ -259,24 +259,24 @@ static inline int pm_genpd_init(struct generic_pm_domain *genpd,
>>  }
>>  static inline int pm_genpd_remove(struct generic_pm_domain *genpd)
>>  {
>> -       return -ENOTSUPP;
>> +       return -EOPNOTSUPP;
>>  }
>>
>>  static inline int dev_pm_genpd_set_performance_state(struct device *dev,
>>                                                      unsigned int state)
>>  {
>> -       return -ENOTSUPP;
>> +       return -EOPNOTSUPP;
>>  }
>>
>>  static inline int dev_pm_genpd_add_notifier(struct device *dev,
>>                                             struct notifier_block *nb)
>>  {
>> -       return -ENOTSUPP;
>> +       return -EOPNOTSUPP;
>>  }
>>
>>  static inline int dev_pm_genpd_remove_notifier(struct device *dev)
>>  {
>> -       return -ENOTSUPP;
>> +       return -EOPNOTSUPP;
>>  }
>>
>>  static inline int dev_pm_genpd_set_next_wakeup(struct device *dev, ktime_t next)
>> @@ -334,13 +334,13 @@ struct device *genpd_dev_pm_attach_by_name(struct device *dev,
>>  static inline int of_genpd_add_provider_simple(struct device_node *np,
>>                                         struct generic_pm_domain *genpd)
>>  {
>> -       return -ENOTSUPP;
>> +       return -EOPNOTSUPP;
>>  }
>>
>>  static inline int of_genpd_add_provider_onecell(struct device_node *np,
>>                                         struct genpd_onecell_data *data)
>>  {
>> -       return -ENOTSUPP;
>> +       return -EOPNOTSUPP;
>>  }
>>
>>  static inline void of_genpd_del_provider(struct device_node *np) {}
>> @@ -396,7 +396,7 @@ static inline struct device *genpd_dev_pm_attach_by_name(struct device *dev,
>>  static inline
>>  struct generic_pm_domain *of_genpd_remove_last(struct device_node *np)
>>  {
>> -       return ERR_PTR(-ENOTSUPP);
>> +       return ERR_PTR(-EOPNOTSUPP);
>>  }
>>  #endif /* CONFIG_PM_GENERIC_DOMAINS_OF */
>>
>> --
>> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
>> a Linux Foundation Collaborative Project
>>
Ulf Hansson Nov. 9, 2020, 3:29 p.m. UTC | #3
On Mon, 9 Nov 2020 at 16:24, Lina Iyer <ilina@codeaurora.org> wrote:
>
> On Mon, Nov 09 2020 at 04:40 -0700, Ulf Hansson wrote:
> >On Fri, 6 Nov 2020 at 17:49, Lina Iyer <ilina@codeaurora.org> wrote:
> >>
> >> While submitting a patch to add next_wakeup, checkpatch reported this -
> >>
> >> WARNING: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP
> >> +       return -ENOTSUPP;
> >>
> >> Address the above warning in other functions in pm_domain.h.
> >>
> >> Signed-off-by: Lina Iyer <ilina@codeaurora.org>
> >
> >I assume you have looked at callers of these functions too, to make
> >sure they don't explicitly look at -ENOTSUPP?
> >
> Yes, the first level callers at least. Most of them seem to return from
> probe calls etc. Is there a nice way to make sure the second level
> functions and the callers of those are not using -ENOTSUPP return from
> these functions.

Good question. But I can't think of one (besides code inspection) -
unless you have a running system.

>
> >Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

Anyway, let's give this a try and see what happens!

Kind regards
Uffe

--
> >>  1 file changed, 7 insertions(+), 7 deletions(-)
> >>
> >> diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
> >> index 49982cd58bfd..e390388e6c17 100644
> >> --- a/include/linux/pm_domain.h
> >> +++ b/include/linux/pm_domain.h
> >> @@ -259,24 +259,24 @@ static inline int pm_genpd_init(struct generic_pm_domain *genpd,
> >>  }
> >>  static inline int pm_genpd_remove(struct generic_pm_domain *genpd)
> >>  {
> >> -       return -ENOTSUPP;
> >> +       return -EOPNOTSUPP;
> >>  }
> >>
> >>  static inline int dev_pm_genpd_set_performance_state(struct device *dev,
> >>                                                      unsigned int state)
> >>  {
> >> -       return -ENOTSUPP;
> >> +       return -EOPNOTSUPP;
> >>  }
> >>
> >>  static inline int dev_pm_genpd_add_notifier(struct device *dev,
> >>                                             struct notifier_block *nb)
> >>  {
> >> -       return -ENOTSUPP;
> >> +       return -EOPNOTSUPP;
> >>  }
> >>
> >>  static inline int dev_pm_genpd_remove_notifier(struct device *dev)
> >>  {
> >> -       return -ENOTSUPP;
> >> +       return -EOPNOTSUPP;
> >>  }
> >>
> >>  static inline int dev_pm_genpd_set_next_wakeup(struct device *dev, ktime_t next)
> >> @@ -334,13 +334,13 @@ struct device *genpd_dev_pm_attach_by_name(struct device *dev,
> >>  static inline int of_genpd_add_provider_simple(struct device_node *np,
> >>                                         struct generic_pm_domain *genpd)
> >>  {
> >> -       return -ENOTSUPP;
> >> +       return -EOPNOTSUPP;
> >>  }
> >>
> >>  static inline int of_genpd_add_provider_onecell(struct device_node *np,
> >>                                         struct genpd_onecell_data *data)
> >>  {
> >> -       return -ENOTSUPP;
> >> +       return -EOPNOTSUPP;
> >>  }
> >>
> >>  static inline void of_genpd_del_provider(struct device_node *np) {}
> >> @@ -396,7 +396,7 @@ static inline struct device *genpd_dev_pm_attach_by_name(struct device *dev,
> >>  static inline
> >>  struct generic_pm_domain *of_genpd_remove_last(struct device_node *np)
> >>  {
> >> -       return ERR_PTR(-ENOTSUPP);
> >> +       return ERR_PTR(-EOPNOTSUPP);
> >>  }
> >>  #endif /* CONFIG_PM_GENERIC_DOMAINS_OF */
> >>
> >> --
> >> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> >> a Linux Foundation Collaborative Project
> >>
diff mbox series

Patch

diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 49982cd58bfd..e390388e6c17 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -259,24 +259,24 @@  static inline int pm_genpd_init(struct generic_pm_domain *genpd,
 }
 static inline int pm_genpd_remove(struct generic_pm_domain *genpd)
 {
-	return -ENOTSUPP;
+	return -EOPNOTSUPP;
 }
 
 static inline int dev_pm_genpd_set_performance_state(struct device *dev,
 						     unsigned int state)
 {
-	return -ENOTSUPP;
+	return -EOPNOTSUPP;
 }
 
 static inline int dev_pm_genpd_add_notifier(struct device *dev,
 					    struct notifier_block *nb)
 {
-	return -ENOTSUPP;
+	return -EOPNOTSUPP;
 }
 
 static inline int dev_pm_genpd_remove_notifier(struct device *dev)
 {
-	return -ENOTSUPP;
+	return -EOPNOTSUPP;
 }
 
 static inline int dev_pm_genpd_set_next_wakeup(struct device *dev, ktime_t next)
@@ -334,13 +334,13 @@  struct device *genpd_dev_pm_attach_by_name(struct device *dev,
 static inline int of_genpd_add_provider_simple(struct device_node *np,
 					struct generic_pm_domain *genpd)
 {
-	return -ENOTSUPP;
+	return -EOPNOTSUPP;
 }
 
 static inline int of_genpd_add_provider_onecell(struct device_node *np,
 					struct genpd_onecell_data *data)
 {
-	return -ENOTSUPP;
+	return -EOPNOTSUPP;
 }
 
 static inline void of_genpd_del_provider(struct device_node *np) {}
@@ -396,7 +396,7 @@  static inline struct device *genpd_dev_pm_attach_by_name(struct device *dev,
 static inline
 struct generic_pm_domain *of_genpd_remove_last(struct device_node *np)
 {
-	return ERR_PTR(-ENOTSUPP);
+	return ERR_PTR(-EOPNOTSUPP);
 }
 #endif /* CONFIG_PM_GENERIC_DOMAINS_OF */