From: Phil Carmody <ext-phil.2.carmody@nokia.com>
To: gregkh@suse.de
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 0/3] Driver core: Encourage use of const attributes
Date: Fri, 18 Dec 2009 15:34:18 +0200 [thread overview]
Message-ID: <1261143261-399-1-git-send-email-ext-phil.2.carmody@nokia.com> (raw)
In-Reply-To: <20091218042007.GA6314@suse.de>
I know now's probably a bad time to be mentioning const issues
but I recently a reviewed a patch where 'const' was being removed
from a device_attribute structure, and I enquired why. The reason
was simply so that device_create_file() could be called, it taking
a non-const attribute pointer. Looking inside, all that function
did was pass a pointer to sysfs_create_file, which itself took a
const pointer. Non-constness was not required at all.
So here I offer a small patchset which I hope will permit and
encourage device and other attributes to be made const, and put
in read-only sections.
These have been compile/sparse tested against arm and x86_64 targets,
and through my usual suite of tests on the arm platform I use.
In addition to the changes in the prior RFC, I have updated the
documentation appropriately.
Regards,
Phil
next prev parent reply other threads:[~2009-12-18 13:34 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-17 18:12 [RFC 0/6] " Phil Carmody
2009-12-17 18:12 ` [RFC 1/6] Driver core: device_attribute parameters can often be const* Phil Carmody
2009-12-17 18:12 ` [RFC 2/6] Driver core: bin_attribute " Phil Carmody
2009-12-17 18:12 ` [RFC 3/6] Driver core: driver_attribute " Phil Carmody
2009-12-17 18:12 ` [RFC 4/6] Driver core: Easy macros to encourage const attributes Phil Carmody
2009-12-17 18:12 ` [RFC 5/6] PM: Example of how easy it is to mark attributes const Phil Carmody
2009-12-17 18:12 ` [RFC 6/6] gpio: " Phil Carmody
2009-12-17 23:16 ` [RFC 0/6] Driver core: Encourage use of const attributes Greg KH
2009-12-18 0:42 ` Stephen Rothwell
2009-12-18 4:20 ` Greg KH
2009-12-18 13:34 ` Phil Carmody [this message]
2009-12-18 13:34 ` [PATCH 1/3] Driver core: device_attribute parameters can often be const* Phil Carmody
2009-12-18 13:34 ` [PATCH 2/3] Driver core: bin_attribute " Phil Carmody
2009-12-18 13:34 ` [PATCH 3/3] Driver core: driver_attribute " Phil Carmody
2009-12-18 8:52 ` [RFC 0/6] Driver core: Encourage use of const attributes Phil Carmody
2009-12-18 16:10 ` Greg KH
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=1261143261-399-1-git-send-email-ext-phil.2.carmody@nokia.com \
--to=ext-phil.2.carmody@nokia.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®