diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2013-11-12 18:11:31 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-12 22:09:34 -0500 |
commit | 1931d433d7a641e6a366854566ab1207a32972a6 (patch) | |
tree | 5492c8b745e5f9bb1d1c609cdb4e3180f61aae6f /kernel/gcov/fs.c | |
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/gcov/fs.c')
-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) | |||
365 | */ | 365 | */ |
366 | static void add_links(struct gcov_node *node, struct dentry *parent) | 366 | static void add_links(struct gcov_node *node, struct dentry *parent) |
367 | { | 367 | { |
368 | char *basename; | 368 | const char *basename; |
369 | char *target; | 369 | char *target; |
370 | int num; | 370 | int num; |
371 | int i; | 371 | int i; |
@@ -381,10 +381,9 @@ static void add_links(struct gcov_node *node, struct dentry *parent) | |||
381 | &gcov_link[i]); | 381 | &gcov_link[i]); |
382 | if (!target) | 382 | if (!target) |
383 | goto out_err; | 383 | goto out_err; |
384 | basename = strrchr(target, '/'); | 384 | basename = kbasename(target); |
385 | if (!basename) | 385 | if (basename == target) |
386 | goto out_err; | 386 | goto out_err; |
387 | basename++; | ||
388 | node->links[i] = debugfs_create_symlink(deskew(basename), | 387 | node->links[i] = debugfs_create_symlink(deskew(basename), |
389 | parent, target); | 388 | parent, target); |
390 | if (!node->links[i]) | 389 | if (!node->links[i]) |