From: Al Viro Date: Sat, 16 Jul 2011 16:41:29 +0000 (-0400) Subject: arm: don't create useless copies to pass into debugfs_create_dir() X-Git-Tag: upstream/snapshot3+hdmi~9590^2~24 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c066b65abfe20b7a23ad3b1161cd67315f65f3c1;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 --- diff --git a/arch/arm/mach-ux500/clock.c b/arch/arm/mach-ux500/clock.c index 1d8509d..7d107be 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, 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; diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c index 43bae2c..964704f 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) 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; }