[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 02 of 18] tools/blktap: constify string arrays in convert_dev_name_to_num



# HG changeset patch
# User Olaf Hering <olaf@xxxxxxxxx>
# Date 1333397505 -7200
# Node ID 569fc8260490b64ae837c6ed67f1a5b2e582744c
# Parent  21640ef72ce861892d71f3916ba6ed0f9a411cca
tools/blktap: constify string arrays in convert_dev_name_to_num

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>

diff -r 21640ef72ce8 -r 569fc8260490 tools/blktap/lib/xs_api.c
--- a/tools/blktap/lib/xs_api.c
+++ b/tools/blktap/lib/xs_api.c
@@ -210,14 +210,15 @@ done:
 }
 
 int convert_dev_name_to_num(char *name) {
-       char *p, *ptr;
+       char *p;
+       const char *ptr;
        int majors[10] = {3,22,33,34,56,57,88,89,90,91};
        int maj,i,ret = 0;
-       char *p_sd = "/dev/sd";
-       char *p_hd = "/dev/hd";
-       char *p_xvd = "/dev/xvd";
-       char *p_plx = "plx";
-       char *alpha = "abcdefghijklmnop";
+       const char p_sd[] = "/dev/sd";
+       const char p_hd[] = "/dev/hd";
+       const char p_xvd[] = "/dev/xvd";
+       const char p_plx[] = "plx";
+       const char alpha[] = "abcdefghijklmnop";
 
        if (strstr(name, p_sd) != NULL) {
                p = name + strlen(p_sd);

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.