From: Greg KH <greg@kroah.com>
To: Zhang Rui <rui.zhang@intel.com>
Cc: linux-kernel@vger.kernel.org,
"linux-acpi@vger" <linux-acpi@vger.kernel.org>,
lenb@kernel.org
Subject: Re: [PATCH]: add parameter "struct bin_attribute *" in .read/.write methods for sysfs binary attributes
Date: Thu, 7 Jun 2007 21:48:09 -0700 [thread overview]
Message-ID: <20070608044809.GB28395@kroah.com> (raw)
In-Reply-To: <1181208695.5317.2.camel@localhost.localdomain>
On Thu, Jun 07, 2007 at 05:31:35PM +0800, Zhang Rui wrote:
> From: Zhang Rui <rui.zhang@intel.com>
>
> Well, first of all, I don't want to change so many files either.
>
> What I do:
> Adding a new parameter "struct bin_attribute *" in the
> .read/.write methods for the sysfs binary attributes.
>
> In fact, only the four lines change in fs/sysfs/bin.c and
> include/linux/sysfs.h do the real work.
> But I have to update all the files that use binary attributes
> to make them compatible with the new .read and .write methods.
> I'm not sure if I missed any. :(
>
> Why I do this:
> For a sysfs attribute, we can get a pointer pointing to the
> struct attribute in the .show/.store method,
> while we can't do this for the binary attributes.
> I don't know why this is different, but this does make it not
> so handy to use the binary attributes as the regular ones.
> So I think this patch is reasonable. :)
>
> Who benefits from it:
> The patch that exposes ACPI tables in sysfs
> requires such an improvement.
> All the table binary attributes share the same .read method.
> Parameter "struct bin_attribute *" is used to get
> the table signature and instance number which are used to
> distinguish different ACPI table binary attributes.
>
> Without this parameter, we need to offer different .read methods
> for different ACPI table binary attributes.
> This is impossible as there are various ACPI tables on different
> platforms, and we don't know what they are until they are loaded.
I have no objection to this patch but it failes the checkpatch.pl script
pretty badly with too long of lines. Care to fix it up and resend it?
thanks,
greg k-h
next prev parent reply other threads:[~2007-06-08 4:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-07 9:31 [PATCH]: add parameter "struct bin_attribute *" in .read/.write methods for sysfs binary attributes Zhang Rui
2007-06-08 4:48 ` Greg KH [this message]
2007-06-08 8:36 ` Zhang Rui
2007-06-08 14:52 ` Greg KH
2007-06-09 5:57 ` Zhang Rui
2007-06-14 1:35 ` Len Brown
2007-06-14 8:38 ` Greg KH
2007-06-09 8:13 ` Zhang Rui
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=20070608044809.GB28395@kroah.com \
--to=greg@kroah.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rui.zhang@intel.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