public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Mikael Pettersson <mikpe@csd.uu.se>
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][2.6.10-rc2-mm4] perfctr sysfs update 1/4: core
Date: Fri, 3 Dec 2004 09:03:51 -0800	[thread overview]
Message-ID: <20041203170351.GG28118@kroah.com> (raw)
In-Reply-To: <16816.14159.597170.829515@alkaid.it.uu.se>

On Fri, Dec 03, 2004 at 10:52:15AM +0100, Mikael Pettersson wrote:
> Greg KH writes:
>  > On Thu, Dec 02, 2004 at 11:10:24AM +0100, Mikael Pettersson wrote:
>  > > +static int __init perfctr_class_init(void)
>  > > +{
>  > > +	int ret;
>  > > +
>  > > +	ret = class_register(&perfctr_class);
>  > > +	if (ret)
>  > > +		return ret;
>  > > +	ret |= class_create_file(&perfctr_class, &class_attr_driver_version);
>  > > +	ret |= class_create_file(&perfctr_class, &class_attr_cpu_type);
>  > > +	ret |= class_create_file(&perfctr_class, &class_attr_cpu_features);
>  > > +	ret |= class_create_file(&perfctr_class, &class_attr_cpu_khz);
>  > > +	ret |= class_create_file(&perfctr_class, &class_attr_tsc_to_cpu_mult);
>  > > +	ret |= class_create_file(&perfctr_class, &class_attr_cpus_online);
>  > > +	ret |= class_create_file(&perfctr_class, &class_attr_cpus_forbidden);
>  > > +	if (ret)
>  > > +		class_unregister(&perfctr_class);
>  > > +	return ret;
>  > 
>  > It's easier to use sysfs_create_group() instead of registering all of
>  > the individual files.
> 
> Thanks for the hint. While looking around I noticed I can simplify
> it even further by having perfctr_class.class_attrs point to an array
> of attributes at class_register() time.

Nice, I forgot about that :)

greg k-h

      reply	other threads:[~2004-12-03 17:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-02 10:10 [PATCH][2.6.10-rc2-mm4] perfctr sysfs update 1/4: core Mikael Pettersson
2004-12-02 18:59 ` Greg KH
2004-12-03  9:52   ` Mikael Pettersson
2004-12-03 17:03     ` Greg KH [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041203170351.GG28118@kroah.com \
    --to=greg@kroah.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikpe@csd.uu.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox