* [PATCH] uio: make uio_info's name and version const
@ 2008-12-12 5:30 Stephen Rothwell
2008-12-12 10:44 ` Hans J. Koch
0 siblings, 1 reply; 4+ messages in thread
From: Stephen Rothwell @ 2008-12-12 5:30 UTC (permalink / raw)
To: Hans J. Koch, Greg Kroah-Hartman; +Cc: LKML, Wolfram Sang
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>
---
Documentation/DocBook/uio-howto.tmpl | 4 ++--
include/linux/uio_driver.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
Tested by compiling all the uio drivers available on x86. The others
(all in arch sh) only ever assign constant string literals to these
fields.
[Resent with properly quoted recipient addresses]
diff --git a/Documentation/DocBook/uio-howto.tmpl b/Documentation/DocBook/uio-howto.tmpl
index df87d1b..21ba47e 100644
--- a/Documentation/DocBook/uio-howto.tmpl
+++ b/Documentation/DocBook/uio-howto.tmpl
@@ -339,12 +339,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>
diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h
index cdf338d..b5f23b1 100644
--- a/include/linux/uio_driver.h
+++ b/include/linux/uio_driver.h
@@ -57,8 +57,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];
long irq;
unsigned long irq_flags;
--
1.6.0.5
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] uio: make uio_info's name and version const
2008-12-12 5:30 [PATCH] uio: make uio_info's name and version const Stephen Rothwell
@ 2008-12-12 10:44 ` Hans J. Koch
2008-12-12 22:51 ` Stephen Rothwell
2008-12-19 0:29 ` patch uio-make-uio_info-s-name-and-version-const.patch added to gregkh-2.6 tree gregkh
0 siblings, 2 replies; 4+ messages in thread
From: Hans J. Koch @ 2008-12-12 10:44 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: Hans J. Koch, Greg Kroah-Hartman, LKML, Wolfram Sang
On Fri, Dec 12, 2008 at 04:30:41PM +1100, Stephen Rothwell wrote:
> These are only ever assigned constant strings and never modified.
Hi Stephen,
that's correct, thanks for pointing this out.
@Greg: Stephen's patch will only apply with some fuzz since you've
accepted my portio patches in your queue. Below there's a version
that should apply cleanly.
>
> 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>
> ---
> Documentation/DocBook/uio-howto.tmpl | 4 ++--
> include/linux/uio_driver.h | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> Tested by compiling all the uio drivers available on x86. The others
> (all in arch sh) only ever assign constant string literals to these
> fields.
>
> [Resent with properly quoted recipient addresses]
>
> diff --git a/Documentation/DocBook/uio-howto.tmpl b/Documentation/DocBook/uio-howto.tmpl
> index df87d1b..21ba47e 100644
> --- a/Documentation/DocBook/uio-howto.tmpl
> +++ b/Documentation/DocBook/uio-howto.tmpl
> @@ -339,12 +339,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>
>
> diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h
> index cdf338d..b5f23b1 100644
> --- a/include/linux/uio_driver.h
> +++ b/include/linux/uio_driver.h
> @@ -57,8 +57,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];
> long irq;
> unsigned long irq_flags;
> --
> 1.6.0.5
--------->8-----begin rebased version------------------------------------
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>
---
Documentation/DocBook/uio-howto.tmpl | 4 ++--
include/linux/uio_driver.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
Tested by compiling all the uio drivers available on x86. The others
(all in arch sh) only ever assign constant string literals to these
fields.
Index: linux-2.6.28-rc/Documentation/DocBook/uio-howto.tmpl
===================================================================
--- linux-2.6.28-rc.orig/Documentation/DocBook/uio-howto.tmpl 2008-12-06 02:08:16.000000000 +0100
+++ linux-2.6.28-rc/Documentation/DocBook/uio-howto.tmpl 2008-12-12 11:28:37.000000000 +0100
@@ -393,12 +393,12 @@
<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>
Index: linux-2.6.28-rc/include/linux/uio_driver.h
===================================================================
--- linux-2.6.28-rc.orig/include/linux/uio_driver.h 2008-12-06 02:07:21.000000000 +0100
+++ linux-2.6.28-rc/include/linux/uio_driver.h 2008-12-12 11:28:37.000000000 +0100
@@ -76,8 +76,8 @@
*/
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;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] uio: make uio_info's name and version const
2008-12-12 10:44 ` Hans J. Koch
@ 2008-12-12 22:51 ` Stephen Rothwell
2008-12-19 0:29 ` patch uio-make-uio_info-s-name-and-version-const.patch added to gregkh-2.6 tree gregkh
1 sibling, 0 replies; 4+ messages in thread
From: Stephen Rothwell @ 2008-12-12 22:51 UTC (permalink / raw)
To: Hans J. Koch; +Cc: Greg Kroah-Hartman, LKML, Wolfram Sang
[-- Attachment #1: Type: text/plain, Size: 391 bytes --]
Hi Hans,
On Fri, 12 Dec 2008 11:44:21 +0100 "Hans J. Koch" <hjk@linutronix.de> wrote:
>
> @Greg: Stephen's patch will only apply with some fuzz since you've
> accepted my portio patches in your queue. Below there's a version
> that should apply cleanly.
Thanks for that.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* patch uio-make-uio_info-s-name-and-version-const.patch added to gregkh-2.6 tree
2008-12-12 10:44 ` Hans J. Koch
2008-12-12 22:51 ` Stephen Rothwell
@ 2008-12-19 0:29 ` gregkh
1 sibling, 0 replies; 4+ messages in thread
From: gregkh @ 2008-12-19 0:29 UTC (permalink / raw)
To: sfr, gregkh, hjk, linux-kernel, w.sang
This is a note to let you know that I've just added the patch titled
Subject: uio: make uio_info's name and version const
to my gregkh-2.6 tree. Its filename is
uio-make-uio_info-s-name-and-version-const.patch
This tree can be found at
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/
>From hjk@linutronix.de Thu Dec 18 15:52:51 2008
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Fri, 12 Dec 2008 11:44:21 +0100
Subject: uio: make uio_info's name and version const
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: "Hans J. Koch" <hjk@linutronix.de>, Greg Kroah-Hartman <gregkh@suse.de>, LKML <linux-kernel@vger.kernel.org>, Wolfram Sang <w.sang@pengutronix.de>
Message-ID: <20081212104420.GA3084@local>
Content-Disposition: inline
From: Stephen Rothwell <sfr@canb.auug.org.au>
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>
---
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@canb.auug.org.au 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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-12-19 0:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-12 5:30 [PATCH] uio: make uio_info's name and version const Stephen Rothwell
2008-12-12 10:44 ` Hans J. Koch
2008-12-12 22:51 ` Stephen Rothwell
2008-12-19 0:29 ` patch uio-make-uio_info-s-name-and-version-const.patch added to gregkh-2.6 tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox