Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1384674 > unrolled thread

[PATCH] PM / OPP: -ENOSYS is applicable only to syscalls

Started byViresh Kumar <viresh.kumar@linaro.org>
First post2016-04-22 05:20 +0200
Last post2016-04-27 04:50 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH] PM / OPP: -ENOSYS is applicable only to syscalls Viresh Kumar <viresh.kumar@linaro.org> - 2016-04-22 05:20 +0200
    Re: [PATCH] PM / OPP: -ENOSYS is applicable only to syscalls "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-04-22 14:40 +0200
      Re: [PATCH] PM / OPP: -ENOSYS is applicable only to syscalls One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk> - 2016-04-22 17:10 +0200
        Re: [PATCH] PM / OPP: -ENOSYS is applicable only to syscalls Viresh Kumar <viresh.kumar@linaro.org> - 2016-04-27 04:50 +0200

#1384674 — [PATCH] PM / OPP: -ENOSYS is applicable only to syscalls

FromViresh Kumar <viresh.kumar@linaro.org>
Date2016-04-22 05:20 +0200
Subject[PATCH] PM / OPP: -ENOSYS is applicable only to syscalls
Message-ID<rqzNn-3nA-5@gated-at.bofh.it>
Some of the routines have use -ENOSYS, which is supposed to be used only
for syscalls. Replace that with -EINVAL.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
I am including this patch into the series and this one will be the first
patch of the series. Also, later patches will be updated to *not* use
-ENOSYS.

I will send out the series again once some sort of reviews are done.

 include/linux/pm_opp.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h
index cccaf4a29e9f..2605ed66f1bd 100644
--- a/include/linux/pm_opp.h
+++ b/include/linux/pm_opp.h
@@ -199,7 +199,7 @@ static inline void dev_pm_opp_of_remove_table(struct device *dev)
 
 static inline int dev_pm_opp_of_cpumask_add_table(cpumask_var_t cpumask)
 {
-	return -ENOSYS;
+	return -EINVAL;
 }
 
 static inline void dev_pm_opp_of_cpumask_remove_table(cpumask_var_t cpumask)
@@ -208,12 +208,12 @@ static inline void dev_pm_opp_of_cpumask_remove_table(cpumask_var_t cpumask)
 
 static inline int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask)
 {
-	return -ENOSYS;
+	return -EINVAL;
 }
 
 static inline int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask)
 {
-	return -ENOSYS;
+	return -EINVAL;
 }
 #endif
 
-- 
2.7.1.410.g6faf27b

[toc] | [next] | [standalone]


#1385122

From"Rafael J. Wysocki" <rjw@rjwysocki.net>
Date2016-04-22 14:40 +0200
Message-ID<rqIxk-1Ux-9@gated-at.bofh.it>
In reply to#1384674
On Friday, April 22, 2016 08:46:51 AM Viresh Kumar wrote:
> Some of the routines have use -ENOSYS, which is supposed to be used only
> for syscalls. Replace that with -EINVAL.

-EINVAL specifically means "invalid argument".

What about using -ENXIO instead?

[toc] | [prev] | [next] | [standalone]


#1385263

FromOne Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
Date2016-04-22 17:10 +0200
Message-ID<rqKSu-3S9-21@gated-at.bofh.it>
In reply to#1385122
On Fri, 22 Apr 2016 14:42:31 +0200
"Rafael J. Wysocki" <rjw@rjwysocki.net> wrote:

> On Friday, April 22, 2016 08:46:51 AM Viresh Kumar wrote:
> > Some of the routines have use -ENOSYS, which is supposed to be used only
> > for syscalls. Replace that with -EINVAL.  
> 
> -EINVAL specifically means "invalid argument".
> 
> What about using -ENXIO instead?

That specifically means "device not present", but might be reasonable.
Quite a bit of the kernel uses EOPNOTSUPP (operation not supported).

Before you change it though please check how existing userspace does
error handling. It's nice to use more "correct" error codes, but that's
not sufficient reason if it turns out that existing user space checks for
ENOSYS for example.

Alan

[toc] | [prev] | [next] | [standalone]


#1388610

FromViresh Kumar <viresh.kumar@linaro.org>
Date2016-04-27 04:50 +0200
Message-ID<rsnI6-1SP-9@gated-at.bofh.it>
In reply to#1385263
On 22-04-16, 15:59, One Thousand Gnomes wrote:
> On Fri, 22 Apr 2016 14:42:31 +0200
> "Rafael J. Wysocki" <rjw@rjwysocki.net> wrote:
> 
> > On Friday, April 22, 2016 08:46:51 AM Viresh Kumar wrote:
> > > Some of the routines have use -ENOSYS, which is supposed to be used only
> > > for syscalls. Replace that with -EINVAL.  
> > 
> > -EINVAL specifically means "invalid argument".
> > 
> > What about using -ENXIO instead?
> 
> That specifically means "device not present", but might be reasonable.
> Quite a bit of the kernel uses EOPNOTSUPP (operation not supported).

That looks reasonable to me.. Will switch to that.

> Before you change it though please check how existing userspace does
> error handling. It's nice to use more "correct" error codes, but that's
> not sufficient reason if it turns out that existing user space checks for
> ENOSYS for example.

Userspace doesn't interact directly with this stuff, its pretty much within the
kernel. So it should be fine.

Thanks Alan.

-- 
viresh

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web