summaryrefslogtreecommitdiffstats
path: root/kernel/gcov
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2013-11-13 00:11:31 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-13 04:09:34 +0100
commit1931d433d7a641e6a366854566ab1207a32972a6 (patch)
tree5492c8b745e5f9bb1d1c609cdb4e3180f61aae6f /kernel/gcov
parentkernel/gcov/fs.c: use pr_warn() (diff)
downloadlinux-1931d433d7a641e6a366854566ab1207a32972a6.tar.xz
linux-1931d433d7a641e6a366854566ab1207a32972a6.zip
gcov: reuse kbasename helper
To get name of the file from a pathname let's use kbasename() helper. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Jingoo Han <jg1.han@samsung.com> Cc: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/gcov')
-rw-r--r--kernel/gcov/fs.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/kernel/gcov/fs.c b/kernel/gcov/fs.c
index e892ad9ea065..15ff01a76379 100644
--- a/kernel/gcov/fs.c
+++ b/kernel/gcov/fs.c
@@ -365,7 +365,7 @@ static const char *deskew(const char *basename)
*/
static void add_links(struct gcov_node *node, struct dentry *parent)
{
- char *basename;
+ const char *basename;
char *target;
int num;
int i;
@@ -381,10 +381,9 @@ static void add_links(struct gcov_node *node, struct dentry *parent)
&gcov_link[i]);
if (!target)
goto out_err;
- basename = strrchr(target, '/');
- if (!basename)
+ basename = kbasename(target);
+ if (basename == target)
goto out_err;
- basename++;
node->links[i] = debugfs_create_symlink(deskew(basename),
parent, target);
if (!node->links[i])