From 86bdc2d3f3983ca84fb2ed4ada92bcb28beeaa3e Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Thu, 25 Oct 2012 12:15:05 +1100 Subject: [PATCH] mm: use kbasename() Signed-off-by: Andy Shevchenko Signed-off-by: Andrew Morton --- mm/memory.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index da0360314e09..f21ac1c33aed 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -60,6 +60,7 @@ #include #include #include +#include #include #include @@ -4057,15 +4058,12 @@ void print_vma_addr(char *prefix, unsigned long ip) struct file *f = vma->vm_file; char *buf = (char *)__get_free_page(GFP_KERNEL); if (buf) { - char *p, *s; + char *p; p = d_path(&f->f_path, buf, PAGE_SIZE); if (IS_ERR(p)) p = "?"; - s = strrchr(p, '/'); - if (s) - p = s+1; - printk("%s%s[%lx+%lx]", prefix, p, + printk("%s%s[%lx+%lx]", prefix, kbasename(p), vma->vm_start, vma->vm_end - vma->vm_start); free_page((unsigned long)buf); -- 2.39.5