diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2013-09-27 10:26:30 +0200 |
---|---|---|
committer | Chris Metcalf <cmetcalf@tilera.com> | 2013-09-30 16:34:46 +0200 |
commit | 0cc96a745059e8daf1d7d6a26672f0ad9056e989 (patch) | |
tree | b2b61326d34abe96307c2ac4b269b1522f57d1b9 /arch | |
parent | tile: use a more conservative __my_cpu_offset in CONFIG_PREEMPT (diff) | |
download | linux-0cc96a745059e8daf1d7d6a26672f0ad9056e989.tar.xz linux-0cc96a745059e8daf1d7d6a26672f0ad9056e989.zip |
arch: tile: re-use kbasename() helper
kbasename() returns the filename part of a pathname.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/tile/kernel/stack.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/arch/tile/kernel/stack.c b/arch/tile/kernel/stack.c index 362284af3afd..c93977a62116 100644 --- a/arch/tile/kernel/stack.c +++ b/arch/tile/kernel/stack.c @@ -23,6 +23,7 @@ #include <linux/mmzone.h> #include <linux/dcache.h> #include <linux/fs.h> +#include <linux/string.h> #include <asm/backtrace.h> #include <asm/page.h> #include <asm/ucontext.h> @@ -332,21 +333,18 @@ static void describe_addr(struct KBacktraceIterator *kbt, } if (vma->vm_file) { - char *s; p = d_path(&vma->vm_file->f_path, buf, bufsize); if (IS_ERR(p)) p = "?"; - s = strrchr(p, '/'); - if (s) - p = s+1; + name = kbasename(p); } else { - p = "anon"; + name = "anon"; } /* Generate a string description of the vma info. */ - namelen = strlen(p); + namelen = strlen(name); remaining = (bufsize - 1) - namelen; - memmove(buf, p, namelen); + memmove(buf, name, namelen); snprintf(buf + namelen, remaining, "[%lx+%lx] ", vma->vm_start, vma->vm_end - vma->vm_start); } |