literal strings are not meant to be modified. So we should use const
char * rather than char * when we we to store a pointer to them.
Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Wei Liu <wl@xen.org>
XEN_NONE = 3
};
-static char *type;
+static const char *type;
static char *ver;
static void cpuid(uint32_t idx, uint32_t *regs, int pv_context)
return ret;
}
-static char *xenhypfs_type(struct xenhypfs_dirent *ent)
+static const char *xenhypfs_type(struct xenhypfs_dirent *ent)
{
- char *res;
+ const char *res;
switch (ent->type) {
case xenhypfs_type_dir:
return ret;
}
-static int xenhypfs_tree_sub(char *path, unsigned int depth)
+static int xenhypfs_tree_sub(const char *path, unsigned int depth)
{
struct xenhypfs_dirent *ent;
unsigned int n, i;