aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@gmail.com>2011-12-12 10:16:51 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-12-20 10:34:52 -0500
commit2b600f9578852d12af59420011e3dadfaa58b043 (patch)
tree80adb42f132c3370525cac2023ca7f4c73fc802d
parent301b195db179241da8be25f345f3c4e64960f1d5 (diff)
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.com Signed-off-by: Namhyung Kim <namhyung@gmail.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/util/symbol.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 632b50c7bc26..e54b13d4c357 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1757,7 +1757,7 @@ static int map_groups__set_modules_path_dir(struct map_groups *mg,
1757 struct stat st; 1757 struct stat st;
1758 1758
1759 /*sshfs might return bad dent->d_type, so we have to stat*/ 1759 /*sshfs might return bad dent->d_type, so we have to stat*/
1760 sprintf(path, "%s/%s", dir_name, dent->d_name); 1760 snprintf(path, sizeof(path), "%s/%s", dir_name, dent->d_name);
1761 if (stat(path, &st)) 1761 if (stat(path, &st))
1762 continue; 1762 continue;
1763 1763
@@ -1766,8 +1766,6 @@ static int map_groups__set_modules_path_dir(struct map_groups *mg,
1766 !strcmp(dent->d_name, "..")) 1766 !strcmp(dent->d_name, ".."))
1767 continue; 1767 continue;
1768 1768
1769 snprintf(path, sizeof(path), "%s/%s",
1770 dir_name, dent->d_name);
1771 ret = map_groups__set_modules_path_dir(mg, path); 1769 ret = map_groups__set_modules_path_dir(mg, path);
1772 if (ret < 0) 1770 if (ret < 0)
1773 goto out; 1771 goto out;
@@ -1788,9 +1786,6 @@ static int map_groups__set_modules_path_dir(struct map_groups *mg,
1788 if (map == NULL) 1786 if (map == NULL)
1789 continue; 1787 continue;
1790 1788
1791 snprintf(path, sizeof(path), "%s/%s",
1792 dir_name, dent->d_name);
1793
1794 long_name = strdup(path); 1789 long_name = strdup(path);
1795 if (long_name == NULL) { 1790 if (long_name == NULL) {
1796 ret = -1; 1791 ret = -1;