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


Groups > linux.kernel > #1515314 > unrolled thread

[PATCH v2 1/2] cpufreq: add new attribute type cpufreq_freq_attr_wr_perm()

Started byMarkus Mayer <code@mmayer.net>
First post2016-11-04 18:00 +0100
Last post2016-11-07 06:40 +0100
Articles 3 — 2 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 v2 1/2] cpufreq: add new attribute type cpufreq_freq_attr_wr_perm() Markus Mayer <code@mmayer.net> - 2016-11-04 18:00 +0100
    Re: [PATCH v2 1/2] cpufreq: add new attribute type  cpufreq_freq_attr_wr_perm() Viresh Kumar <viresh.kumar@linaro.org> - 2016-11-07 05:40 +0100
    Re: [PATCH v2 1/2] cpufreq: add new attribute type  cpufreq_freq_attr_wr_perm() Viresh Kumar <viresh.kumar@linaro.org> - 2016-11-07 06:40 +0100

#1515314 — [PATCH v2 1/2] cpufreq: add new attribute type cpufreq_freq_attr_wr_perm()

FromMarkus Mayer <code@mmayer.net>
Date2016-11-04 18:00 +0100
Subject[PATCH v2 1/2] cpufreq: add new attribute type cpufreq_freq_attr_wr_perm()
Message-ID<szQ0q-4l3-1@gated-at.bofh.it>
From: Markus Mayer <mmayer@broadcom.com>

With the new attribute type, it is possible to create write-only
CPUfreq attributes.

Signed-off-by: Markus Mayer <mmayer@broadcom.com>
---
 include/linux/cpufreq.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 5fa55fc..ed09930 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -234,6 +234,10 @@ __ATTR(_name, _perm, show_##_name, NULL)
 static struct freq_attr _name =			\
 __ATTR(_name, 0644, show_##_name, store_##_name)
 
+#define cpufreq_freq_attr_wr_perm(_name, _perm)	\
+static struct freq_attr _name =			\
+__ATTR(_name, _perm, NULL, store_##_name)
+
 struct global_attr {
 	struct attribute attr;
 	ssize_t (*show)(struct kobject *kobj,
-- 
2.7.4

[toc] | [next] | [standalone]


#1515844 — Re: [PATCH v2 1/2] cpufreq: add new attribute type cpufreq_freq_attr_wr_perm()

FromViresh Kumar <viresh.kumar@linaro.org>
Date2016-11-07 05:40 +0100
SubjectRe: [PATCH v2 1/2] cpufreq: add new attribute type cpufreq_freq_attr_wr_perm()
Message-ID<sAJSV-6w9-1@gated-at.bofh.it>
In reply to#1515314
On 07-11-16, 10:03, Viresh Kumar wrote:
> On 04-11-16, 09:55, Markus Mayer wrote:
> > From: Markus Mayer <mmayer@broadcom.com>
> > 
> > With the new attribute type, it is possible to create write-only
> > CPUfreq attributes.
> > 
> > Signed-off-by: Markus Mayer <mmayer@broadcom.com>
> > ---
> >  include/linux/cpufreq.h | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
> > index 5fa55fc..ed09930 100644
> > --- a/include/linux/cpufreq.h
> > +++ b/include/linux/cpufreq.h
> > @@ -234,6 +234,10 @@ __ATTR(_name, _perm, show_##_name, NULL)
> >  static struct freq_attr _name =			\
> >  __ATTR(_name, 0644, show_##_name, store_##_name)
> >  
> > +#define cpufreq_freq_attr_wr_perm(_name, _perm)	\
> 
> shouldn't this be _wo_perm ?
> 
> Also, I wouldn't mind doing this in the second patch itself.

Also there is no need to define a _perm variant here, and then you can avoid
sending 0200 as argument as well.

-- 
viresh

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


#1515850 — Re: [PATCH v2 1/2] cpufreq: add new attribute type cpufreq_freq_attr_wr_perm()

FromViresh Kumar <viresh.kumar@linaro.org>
Date2016-11-07 06:40 +0100
SubjectRe: [PATCH v2 1/2] cpufreq: add new attribute type cpufreq_freq_attr_wr_perm()
Message-ID<sAJSV-6w9-3@gated-at.bofh.it>
In reply to#1515314
On 04-11-16, 09:55, Markus Mayer wrote:
> From: Markus Mayer <mmayer@broadcom.com>
> 
> With the new attribute type, it is possible to create write-only
> CPUfreq attributes.
> 
> Signed-off-by: Markus Mayer <mmayer@broadcom.com>
> ---
>  include/linux/cpufreq.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
> index 5fa55fc..ed09930 100644
> --- a/include/linux/cpufreq.h
> +++ b/include/linux/cpufreq.h
> @@ -234,6 +234,10 @@ __ATTR(_name, _perm, show_##_name, NULL)
>  static struct freq_attr _name =			\
>  __ATTR(_name, 0644, show_##_name, store_##_name)
>  
> +#define cpufreq_freq_attr_wr_perm(_name, _perm)	\

shouldn't this be _wo_perm ?

Also, I wouldn't mind doing this in the second patch itself.

> +static struct freq_attr _name =			\
> +__ATTR(_name, _perm, NULL, store_##_name)
> +
>  struct global_attr {
>  	struct attribute attr;
>  	ssize_t (*show)(struct kobject *kobj,
> -- 
> 2.7.4

-- 
viresh

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web