From cbee1f7572ce21bc73835e927bd54d3433ed09ac Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Sat, 3 Nov 2012 11:42:48 +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 609f42f93c12..bcbc0844ed75 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -60,6 +60,7 @@ #include #include #include +#include #include #include @@ -4062,15 +4063,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