arm: don't create useless copies to pass into debugfs_create_dir()
its first argument is const char * and it's really not modified... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
12520c438f
commit
c066b65abf
@ -636,15 +636,12 @@ static struct dentry *clk_debugfs_register_dir(struct clk *c,
|
|||||||
struct dentry *p_dentry)
|
struct dentry *p_dentry)
|
||||||
{
|
{
|
||||||
struct dentry *d, *clk_d;
|
struct dentry *d, *clk_d;
|
||||||
char s[255];
|
const char *p = c->name;
|
||||||
char *p = s;
|
|
||||||
|
|
||||||
if (c->name == NULL)
|
if (!p)
|
||||||
p += sprintf(p, "BUG");
|
p = "BUG";
|
||||||
else
|
|
||||||
p += sprintf(p, "%s", c->name);
|
|
||||||
|
|
||||||
clk_d = debugfs_create_dir(s, p_dentry);
|
clk_d = debugfs_create_dir(p, p_dentry);
|
||||||
if (!clk_d)
|
if (!clk_d)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -482,11 +482,8 @@ static int clk_debugfs_register_one(struct clk *c)
|
|||||||
int err;
|
int err;
|
||||||
struct dentry *d;
|
struct dentry *d;
|
||||||
struct clk *pa = c->parent;
|
struct clk *pa = c->parent;
|
||||||
char s[255];
|
|
||||||
char *p = s;
|
|
||||||
|
|
||||||
p += sprintf(p, "%s", c->name);
|
d = debugfs_create_dir(c->name, pa ? pa->dent : clk_debugfs_root);
|
||||||
d = debugfs_create_dir(s, pa ? pa->dent : clk_debugfs_root);
|
|
||||||
if (!d)
|
if (!d)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
c->dent = d;
|
c->dent = d;
|
||||||
@ -509,7 +506,6 @@ static int clk_debugfs_register_one(struct clk *c)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_out:
|
err_out:
|
||||||
d = c->dent;
|
|
||||||
debugfs_remove_recursive(c->dent);
|
debugfs_remove_recursive(c->dent);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user