arm: don't create useless copies to pass into debugfs_create_dir()
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 16 Jul 2011 16:41:29 +0000 (12:41 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 21 Jul 2011 00:47:52 +0000 (20:47 -0400)
its first argument is const char * and it's really not modified...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/arm/mach-ux500/clock.c
arch/arm/plat-omap/clock.c

index 1d8509d59c0972e0411667d788ca28fb96dfeac2..7d107be63eb4cbcaf1635df01f15049cbdc53f59 100644 (file)
@@ -636,15 +636,12 @@ static struct dentry *clk_debugfs_register_dir(struct clk *c,
                                                struct dentry *p_dentry)
 {
        struct dentry *d, *clk_d;
-       char s[255];
-       char *p = s;
+       const char *p = c->name;
 
-       if (c->name == NULL)
-               p += sprintf(p, "BUG");
-       else
-               p += sprintf(p, "%s", c->name);
+       if (!p)
+               p = "BUG";
 
-       clk_d = debugfs_create_dir(s, p_dentry);
+       clk_d = debugfs_create_dir(p, p_dentry);
        if (!clk_d)
                return NULL;
 
index 43bae2c1e34d3ef1f2a2763a0afec101f1024fc4..964704f40bbeecd80ffa646eb4008ce9657b86c8 100644 (file)
@@ -482,11 +482,8 @@ static int clk_debugfs_register_one(struct clk *c)
        int err;
        struct dentry *d;
        struct clk *pa = c->parent;
-       char s[255];
-       char *p = s;
 
-       p += sprintf(p, "%s", c->name);
-       d = debugfs_create_dir(s, pa ? pa->dent : clk_debugfs_root);
+       d = debugfs_create_dir(c->name, pa ? pa->dent : clk_debugfs_root);
        if (!d)
                return -ENOMEM;
        c->dent = d;
@@ -509,7 +506,6 @@ static int clk_debugfs_register_one(struct clk *c)
        return 0;
 
 err_out:
-       d = c->dent;
        debugfs_remove_recursive(c->dent);
        return err;
 }