diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-16 12:41:29 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-20 20:47:52 -0400 |
commit | c066b65abfe20b7a23ad3b1161cd67315f65f3c1 (patch) | |
tree | 79df0fee06603e497dafe1bc950c5c5e03c881da /arch | |
parent | 12520c438f48113593130d210eba821a532c893b (diff) |
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-ux500/clock.c | 11 | ||||
-rw-r--r-- | arch/arm/plat-omap/clock.c | 6 |
2 files changed, 5 insertions, 12 deletions
diff --git a/arch/arm/mach-ux500/clock.c b/arch/arm/mach-ux500/clock.c index 1d8509d59c09..7d107be63eb4 100644 --- a/arch/arm/mach-ux500/clock.c +++ b/arch/arm/mach-ux500/clock.c | |||
@@ -636,15 +636,12 @@ static struct dentry *clk_debugfs_register_dir(struct clk *c, | |||
636 | struct dentry *p_dentry) | 636 | struct dentry *p_dentry) |
637 | { | 637 | { |
638 | struct dentry *d, *clk_d; | 638 | struct dentry *d, *clk_d; |
639 | char s[255]; | 639 | const char *p = c->name; |
640 | char *p = s; | ||
641 | 640 | ||
642 | if (c->name == NULL) | 641 | if (!p) |
643 | p += sprintf(p, "BUG"); | 642 | p = "BUG"; |
644 | else | ||
645 | p += sprintf(p, "%s", c->name); | ||
646 | 643 | ||
647 | clk_d = debugfs_create_dir(s, p_dentry); | 644 | clk_d = debugfs_create_dir(p, p_dentry); |
648 | if (!clk_d) | 645 | if (!clk_d) |
649 | return NULL; | 646 | return NULL; |
650 | 647 | ||
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c index 43bae2c1e34d..964704f40bbe 100644 --- a/arch/arm/plat-omap/clock.c +++ b/arch/arm/plat-omap/clock.c | |||
@@ -482,11 +482,8 @@ static int clk_debugfs_register_one(struct clk *c) | |||
482 | int err; | 482 | int err; |
483 | struct dentry *d; | 483 | struct dentry *d; |
484 | struct clk *pa = c->parent; | 484 | struct clk *pa = c->parent; |
485 | char s[255]; | ||
486 | char *p = s; | ||
487 | 485 | ||
488 | p += sprintf(p, "%s", c->name); | 486 | d = debugfs_create_dir(c->name, pa ? pa->dent : clk_debugfs_root); |
489 | d = debugfs_create_dir(s, pa ? pa->dent : clk_debugfs_root); | ||
490 | if (!d) | 487 | if (!d) |
491 | return -ENOMEM; | 488 | return -ENOMEM; |
492 | c->dent = d; | 489 | c->dent = d; |
@@ -509,7 +506,6 @@ static int clk_debugfs_register_one(struct clk *c) | |||
509 | return 0; | 506 | return 0; |
510 | 507 | ||
511 | err_out: | 508 | err_out: |
512 | d = c->dent; | ||
513 | debugfs_remove_recursive(c->dent); | 509 | debugfs_remove_recursive(c->dent); |
514 | return err; | 510 | return err; |
515 | } | 511 | } |