Skip to content

Commit

Permalink
arm: don't create useless copies to pass into debugfs_create_dir()
Browse files Browse the repository at this point in the history
its first argument is const char * and it's really not modified...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Jul 21, 2011
1 parent 12520c4 commit c066b65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
11 changes: 4 additions & 7 deletions arch/arm/mach-ux500/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
6 changes: 1 addition & 5 deletions arch/arm/plat-omap/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down

0 comments on commit c066b65

Please sign in to comment.