Skip to content

Commit

Permalink
uio: make uio_info's name and version const
Browse files Browse the repository at this point in the history
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@canb.auug.org.au>
Signed-off-by: Hans J. Koch <hjk@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Stephen Rothwell authored and Greg Kroah-Hartman committed Jan 6, 2009
1 parent a2ab3d3 commit b8ac9fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Documentation/DocBook/uio-howto.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
4 changes: 2 additions & 2 deletions include/linux/uio_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b8ac9fc

Please sign in to comment.