Messages in this thread | | | From | Phil Carmody <> | Subject | [PATCH 0/3] Driver core: Encourage use of const attributes | Date | Fri, 18 Dec 2009 15:34:18 +0200 |
| |
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
| |