public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yani Ioannou <yani.ioannou@gmail.com>
To: Greg KH <greg@kroah.com>
Cc: LM Sensors <sensors@stimpy.netroedge.com>,
	linux-kernel@vger.kernel.org,
	Justin Thiessen <jthiessen@penguincomputing.com>
Subject: Re: [PATCH 2.6.12-rc4 3/3] (dynamic sysfs callbacks) device_attribute
Date: Wed, 11 May 2005 15:57:37 -0400	[thread overview]
Message-ID: <25381867050511125761fcfad0@mail.gmail.com> (raw)
In-Reply-To: <20050511170600.GD15398@kroah.com>

On 5/11/05, Greg KH <greg@kroah.com> wrote:
> On Wed, May 11, 2005 at 03:58:35AM -0400, Yani Ioannou wrote:
> > -static ssize_t show_in(struct device *dev, char *buf, int nr)
> > +static ssize_t show_in(struct device *dev, char *buf, void *private)
> >  {
> > +     int nr = *((int*)private);
> 
> What's wrong with a simple:
>         int nr = (int)private;

Ouch, yes thanks for catching that, that's horribly wrong. Its a
leftover from a previous example where I was actually was passing int*
not int. I'll fix up the example and resend it. That is what comes
from not being able to test it I guess.

> Sorry, but I need a real patch in email form so I can apply it.  I can
> handle a 300K+ email :)
> 
> Or you can break it up into smaller pieces, like one per major part of
> the kernel.  That is the preferred way.

I'd like to break it up, but I think even broken up by major part of
the kernel it one piece will still be too large since the majority of
the changes take place in drivers & drivers/i2c and are very
asymmetric :-(. I'll send you the patch inline privately for now.

> We should make a __ATTR macro instead, right?

Well another __ATTR macro (e.g. ATTR_PRIVATE) would make declaring the
new DEVICE_ATTR_PRIVATE macro, etc, easier. We can't really use __ATTR
nicely though when declaring static attributes and wanting to set the
private data, hence why I think there is the need for a macro (see
http://archives.andrew.net.au/lm-sensors/msg31399.html).

The question really is, is it better to just add that new parameter to
the DEVICE_ATTR macro, or to declare a new DEVICE_ATTR_PRIVATE macro
instead. The former obviously breaks a lot of code although my scripts
can generate another large patch for that too...

Thanks,
Yani

  reply	other threads:[~2005-05-11 19:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-11  7:58 [PATCH 2.6.12-rc4 3/3] (dynamic sysfs callbacks) device_attribute Yani Ioannou
2005-05-11 17:06 ` Greg KH
2005-05-11 19:57   ` Yani Ioannou [this message]
2005-05-11 20:28     ` Greg KH
2005-05-11 17:07 ` Greg KH
2005-05-11 20:10   ` [PATCH 2.6.12-rc4] (dynamic sysfs callbacks) adm1026 (2nd try) Yani Ioannou

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=25381867050511125761fcfad0@mail.gmail.com \
    --to=yani.ioannou@gmail.com \
    --cc=greg@kroah.com \
    --cc=jthiessen@penguincomputing.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sensors@stimpy.netroedge.com \
    /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