Skip to content

Commit

Permalink
gcov: reuse kbasename helper
Browse files Browse the repository at this point in the history
To get name of the file from a pathname let's use kbasename() helper.

Signed-off-by: Andy Shevchenko <[email protected]>
Cc: Jingoo Han <[email protected]>
Cc: Peter Oberparleiter <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
andy-shev authored and torvalds committed Nov 13, 2013
1 parent a5ebb87 commit 1931d43
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions kernel/gcov/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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])
Expand Down

0 comments on commit 1931d43

Please sign in to comment.