uio: make uio_info's name and version const

From: Stephen Rothwell
Date: Fri Dec 12 2008 - 05:44:21 EST


From: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>

These are only ever assigned constant strings and never modified.

This was noticed because Wolfram Sang needed to cast the result of
of_get_property() in order to assign it to the name field of a struct
uio_info.

Signed-off-by: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
Signed-off-by: Hans J. Koch <hjk@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
Documentation/DocBook/uio-howto.tmpl | 4 ++--
include/linux/uio_driver.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)

--- a/Documentation/DocBook/uio-howto.tmpl
+++ b/Documentation/DocBook/uio-howto.tmpl
@@ -393,12 +393,12 @@ offset = N * getpagesize();

<itemizedlist>
<listitem><para>
-<varname>char *name</varname>: Required. The name of your driver as
+<varname>const char *name</varname>: Required. The name of your driver as
it will appear in sysfs. I recommend using the name of your module for this.
</para></listitem>

<listitem><para>
-<varname>char *version</varname>: Required. This string appears in
+<varname>const char *version</varname>: Required. This string appears in
<filename>/sys/class/uio/uioX/version</filename>.
</para></listitem>

--- a/include/linux/uio_driver.h
+++ b/include/linux/uio_driver.h
@@ -76,8 +76,8 @@ struct uio_device;
*/
struct uio_info {
struct uio_device *uio_dev;
- char *name;
- char *version;
+ const char *name;
+ const char *version;
struct uio_mem mem[MAX_UIO_MAPS];
struct uio_port port[MAX_UIO_PORT_REGIONS];
long irq;


Patches currently in gregkh-2.6 which might be from sfr@xxxxxxxxxxxxxxxx are

usb/usb-don-t-use-__module_param_call.patch
driver-core/uio-make-uio_info-s-name-and-version-const.patch
staging/staging-go7007-convert-driver-to-use-video_ioctl2.patch
staging/staging-comedi-fix-build-if-config_proc_fs-is-not-set.patch
staging/staging-meilhaus-fix-__symbol_get-problems.patch
--
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/