linux: Allow xenbus_strstate() to be used from modules.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 2 Feb 2007 16:04:11 +0000 (16:04 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 2 Feb 2007 16:04:11 +0000 (16:04 +0000)
The function is referenced by a number of DPRINTK()-s. Also, properly
const-ify it.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c
linux-2.6-xen-sparse/include/xen/xenbus.h

index f294ec1cc9fb8e455653f33c513e70cdb0276d24..49878d17e07d7c25cccd328bd030dcfe3a1afc15 100644 (file)
@@ -42,9 +42,9 @@
 #define DPRINTK(fmt, args...) \
     pr_debug("xenbus_client (%s:%d) " fmt ".\n", __FUNCTION__, __LINE__, ##args)
 
-char *xenbus_strstate(enum xenbus_state state)
+const char *xenbus_strstate(enum xenbus_state state)
 {
-       static char *name[] = {
+       static const char *const name[] = {
                [ XenbusStateUnknown      ] = "Unknown",
                [ XenbusStateInitialising ] = "Initialising",
                [ XenbusStateInitWait     ] = "InitWait",
@@ -55,6 +55,7 @@ char *xenbus_strstate(enum xenbus_state state)
        };
        return (state < ARRAY_SIZE(name)) ? name[state] : "INVALID";
 }
+EXPORT_SYMBOL_GPL(xenbus_strstate);
 
 int xenbus_watch_path(struct xenbus_device *dev, const char *path,
                      struct xenbus_watch *watch,
index a26ca12820310930e2fffd419975a36941ad15c8..cbf6fe351d2670a6c91a883e651a6d9aec6bef40 100644 (file)
@@ -295,7 +295,7 @@ void xenbus_dev_fatal(struct xenbus_device *dev, int err, const char *fmt,
 
 int __init xenbus_dev_init(void);
 
-char *xenbus_strstate(enum xenbus_state state);
+const char *xenbus_strstate(enum xenbus_state state);
 int xenbus_dev_is_online(struct xenbus_device *dev);
 int xenbus_frontend_closed(struct xenbus_device *dev);