WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] linux: Allow xenbus_strstate() to be used from modul

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] linux: Allow xenbus_strstate() to be used from modules
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Thu, 01 Feb 2007 16:50:23 +0000
Delivery-date: Thu, 01 Feb 2007 08:49:36 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
The function is referenced by a number of DPRINTK()-s. Also, properly const-ify 
it.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

Index: head-2007-01-16/drivers/xen/xenbus/xenbus_client.c
===================================================================
--- head-2007-01-16.orig/drivers/xen/xenbus/xenbus_client.c     2007-01-17 
10:10:12.000000000 +0100
+++ head-2007-01-16/drivers/xen/xenbus/xenbus_client.c  2007-01-29 
16:13:36.000000000 +0100
@@ -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 
        };
        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: head-2007-01-16/include/xen/xenbus.h
===================================================================
--- head-2007-01-16.orig/include/xen/xenbus.h   2007-01-17 10:09:52.000000000 
+0100
+++ head-2007-01-16/include/xen/xenbus.h        2007-01-29 16:14:09.000000000 
+0100
@@ -295,7 +295,7 @@ void xenbus_dev_fatal(struct xenbus_devi
 
 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);
 


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] linux: Allow xenbus_strstate() to be used from modules, Jan Beulich <=