提交 2b600f95 编写于 作者: N Namhyung Kim 提交者: Arnaldo Carvalho de Melo

perf symbols: Get rid of duplicated snprintf()

The 'path' variable is set on a upper line, don't need to do it again.

Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1323703017-6060-3-git-send-email-namhyung@gmail.comSigned-off-by: NNamhyung Kim <namhyung@gmail.com>
Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 301b195d
...@@ -1757,7 +1757,7 @@ static int map_groups__set_modules_path_dir(struct map_groups *mg, ...@@ -1757,7 +1757,7 @@ static int map_groups__set_modules_path_dir(struct map_groups *mg,
struct stat st; struct stat st;
/*sshfs might return bad dent->d_type, so we have to stat*/ /*sshfs might return bad dent->d_type, so we have to stat*/
sprintf(path, "%s/%s", dir_name, dent->d_name); snprintf(path, sizeof(path), "%s/%s", dir_name, dent->d_name);
if (stat(path, &st)) if (stat(path, &st))
continue; continue;
...@@ -1766,8 +1766,6 @@ static int map_groups__set_modules_path_dir(struct map_groups *mg, ...@@ -1766,8 +1766,6 @@ static int map_groups__set_modules_path_dir(struct map_groups *mg,
!strcmp(dent->d_name, "..")) !strcmp(dent->d_name, ".."))
continue; continue;
snprintf(path, sizeof(path), "%s/%s",
dir_name, dent->d_name);
ret = map_groups__set_modules_path_dir(mg, path); ret = map_groups__set_modules_path_dir(mg, path);
if (ret < 0) if (ret < 0)
goto out; goto out;
...@@ -1788,9 +1786,6 @@ static int map_groups__set_modules_path_dir(struct map_groups *mg, ...@@ -1788,9 +1786,6 @@ static int map_groups__set_modules_path_dir(struct map_groups *mg,
if (map == NULL) if (map == NULL)
continue; continue;
snprintf(path, sizeof(path), "%s/%s",
dir_name, dent->d_name);
long_name = strdup(path); long_name = strdup(path);
if (long_name == NULL) { if (long_name == NULL) {
ret = -1; ret = -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册