Commit 1931d433 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Linus Torvalds

gcov: reuse kbasename helper

To get name of the file from a pathname let's use kbasename() helper.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Jingoo Han <jg1.han@samsung.com>
Cc: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a5ebb875
...@@ -365,7 +365,7 @@ static const char *deskew(const char *basename) ...@@ -365,7 +365,7 @@ static const char *deskew(const char *basename)
*/ */
static void add_links(struct gcov_node *node, struct dentry *parent) static void add_links(struct gcov_node *node, struct dentry *parent)
{ {
char *basename; const char *basename;
char *target; char *target;
int num; int num;
int i; int i;
...@@ -381,10 +381,9 @@ static void add_links(struct gcov_node *node, struct dentry *parent) ...@@ -381,10 +381,9 @@ static void add_links(struct gcov_node *node, struct dentry *parent)
&gcov_link[i]); &gcov_link[i]);
if (!target) if (!target)
goto out_err; goto out_err;
basename = strrchr(target, '/'); basename = kbasename(target);
if (!basename) if (basename == target)
goto out_err; goto out_err;
basename++;
node->links[i] = debugfs_create_symlink(deskew(basename), node->links[i] = debugfs_create_symlink(deskew(basename),
parent, target); parent, target);
if (!node->links[i]) if (!node->links[i])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment