[PATCH 0/3] Driver core: Encourage use of const attributes

From: Phil Carmody
Date: Fri Dec 18 2009 - 08:34:59 EST



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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/