diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2013-11-12 15:11:31 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-13 12:09:34 +0900 |
commit | 1931d433d7a641e6a366854566ab1207a32972a6 (patch) | |
tree | 5492c8b745e5f9bb1d1c609cdb4e3180f61aae6f /kernel | |
parent | a5ebb87508a48d7816a6897ed53419e46a507eb5 (diff) |
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')
-rw-r--r-- | kernel/gcov/fs.c | 7 |
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]) |