Skip to content

Commit

Permalink
lib: dynamic_debug: use kbasename()
Browse files Browse the repository at this point in the history
Remove the custom implementation of the functionality similar to kbasename().

Signed-off-by: Andy Shevchenko <[email protected]>
Cc: Jason Baron <[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 Dec 18, 2012
1 parent b18888a commit 35367ab
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions lib/dynamic_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,6 @@ static LIST_HEAD(ddebug_tables);
static int verbose = 0;
module_param(verbose, int, 0644);

/* Return the last part of a pathname */
static inline const char *basename(const char *path)
{
const char *tail = strrchr(path, '/');
return tail ? tail+1 : path;
}

/* Return the path relative to source root */
static inline const char *trim_prefix(const char *path)
{
Expand Down Expand Up @@ -154,7 +147,7 @@ static int ddebug_change(const struct ddebug_query *query,
/* match against the source filename */
if (query->filename &&
strcmp(query->filename, dp->filename) &&
strcmp(query->filename, basename(dp->filename)) &&
strcmp(query->filename, kbasename(dp->filename)) &&
strcmp(query->filename, trim_prefix(dp->filename)))
continue;

Expand Down

0 comments on commit 35367ab

Please sign in to comment.