From: Mauro Carvalho Chehab <mchehab@infradead.org>
To: Wolfram Sang <w.sang@pengutronix.de>
Cc: platform-driver-x86@vger.kernel.org,
Len Brown <len.brown@intel.com>, Michal Simek <monstr@monstr.eu>,
linux-media@vger.kernel.org, Lin Ming <ming.m.lin@intel.com>,
Krzysztof Helt <krzysztof.h1@wp.pl>, Greg KH <gregkh@suse.de>,
linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org,
Bob Moore <robert.moore@intel.com>,
Kai Jiang <b18973@freescale.com>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Sujith Thomas <sujith.thomas@intel.com>,
Andrew Morton <akpm@linux-foundation.org>,
Anatolij Gustschin <agust@denx.de>, Mike Isely <isely@pobox.com>,
Johannes Berg <johannes@sipsolutions.net>,
Matthew Garrett <mjg@redhat.com>
Subject: Re: [PATCH 2/2] device_attributes: add sysfs_attr_init() for dynamic attributes
Date: Thu, 08 Apr 2010 19:55:44 -0300 [thread overview]
Message-ID: <4BBE5EF0.5000801@infradead.org> (raw)
In-Reply-To: <1270170140-325-2-git-send-email-w.sang@pengutronix.de>
Wolfram Sang wrote:
> Made necessary by 6992f5334995af474c2b58d010d08bc597f0f2fe. Prevents further
> "key xxx not in .data" bug-reports. Although some attributes could probably be
> converted to static ones, this is left for people having hardware to test.
>
> Found by this semantic patch:
>
> @ init @
> type T;
> identifier A;
> @@
>
> T {
> ...
> struct device_attribute A;
> ...
> };
>
> @ main extends init @
> expression E;
> statement S;
> identifier err;
> T *name;
> @@
>
> ... when != sysfs_attr_init(&name->A.attr);
> (
> + sysfs_attr_init(&name->A.attr);
> if (device_create_file(E, &name->A))
> S
> |
> + sysfs_attr_init(&name->A.attr);
> err = device_create_file(E, &name->A);
> )
>
> While reviewing, I put the initialization to apropriate places.
>
> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> Cc: Eric W. Biederman <ebiederm@xmission.com>
> Cc: Greg KH <gregkh@suse.de>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> ---
> drivers/macintosh/windfarm_core.c | 1 +
> drivers/media/video/pvrusb2/pvrusb2-sysfs.c | 8 ++++++++
I suspect that several (if not all) occurrences at pvrusb2 could be replaced by
static attributes, but let Mike Isely have the final word on that, as the driver
maintainer. From my side, I'm ok with either options.
Cheers,
Mauro
prev parent reply other threads:[~2010-04-08 22:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1270170140-325-1-git-send-email-w.sang@pengutronix.de>
2010-04-02 1:02 ` [PATCH 2/2] device_attributes: add sysfs_attr_init() for dynamic attributes Wolfram Sang
2010-04-08 22:55 ` Mauro Carvalho Chehab [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=4BBE5EF0.5000801@infradead.org \
--to=mchehab@infradead.org \
--cc=agust@denx.de \
--cc=akpm@linux-foundation.org \
--cc=b18973@freescale.com \
--cc=ebiederm@xmission.com \
--cc=gregkh@suse.de \
--cc=isely@pobox.com \
--cc=johannes@sipsolutions.net \
--cc=krzysztof.h1@wp.pl \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=ming.m.lin@intel.com \
--cc=mjg@redhat.com \
--cc=monstr@monstr.eu \
--cc=platform-driver-x86@vger.kernel.org \
--cc=robert.moore@intel.com \
--cc=sujith.thomas@intel.com \
--cc=w.sang@pengutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).