summaryrefslogtreecommitdiffstats
path: root/arch/tile/kernel
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2013-09-27 10:26:30 +0200
committerChris Metcalf <cmetcalf@tilera.com>2013-09-30 16:34:46 +0200
commit0cc96a745059e8daf1d7d6a26672f0ad9056e989 (patch)
treeb2b61326d34abe96307c2ac4b269b1522f57d1b9 /arch/tile/kernel
parenttile: use a more conservative __my_cpu_offset in CONFIG_PREEMPT (diff)
downloadlinux-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/tile/kernel')
-rw-r--r--arch/tile/kernel/stack.c12
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);
}