Skip to content

Commit 35367ab

Browse files
andy-shevtorvalds
authored andcommitted
lib: dynamic_debug: use kbasename()
Remove the custom implementation of the functionality similar to kbasename(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Jason Baron <jbaron@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent b18888a commit 35367ab

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

‎lib/dynamic_debug.c‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,6 @@ static LIST_HEAD(ddebug_tables);
6262
static int verbose = 0;
6363
module_param(verbose, int, 0644);
6464

65-
/* Return the last part of a pathname */
66-
static inline const char *basename(const char *path)
67-
{
68-
const char *tail = strrchr(path, '/');
69-
return tail ? tail+1 : path;
70-
}
71-
7265
/* Return the path relative to source root */
7366
static inline const char *trim_prefix(const char *path)
7467
{
@@ -154,7 +147,7 @@ static int ddebug_change(const struct ddebug_query *query,
154147
/* match against the source filename */
155148
if (query->filename &&
156149
strcmp(query->filename, dp->filename) &&
157-
strcmp(query->filename, basename(dp->filename)) &&
150+
strcmp(query->filename, kbasename(dp->filename)) &&
158151
strcmp(query->filename, trim_prefix(dp->filename)))
159152
continue;
160153

0 commit comments

Comments
 (0)