mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-23 20:24:12 +08:00
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>
This commit is contained in:
parent
a5ebb87508
commit
1931d433d7
@ -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])
|
||||
|
Loading…
Reference in New Issue
Block a user