]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm: use kbasename()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 25 Oct 2012 01:15:05 +0000 (12:15 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 1 Nov 2012 04:24:14 +0000 (15:24 +1100)
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memory.c

index da0360314e094d1181c60b41462535fbe1002a4c..f21ac1c33aed6db560e8cc14f280152bc795cb11 100644 (file)
@@ -60,6 +60,7 @@
 #include <linux/elf.h>
 #include <linux/gfp.h>
 #include <linux/migrate.h>
+#include <linux/string.h>
 
 #include <asm/io.h>
 #include <asm/pgalloc.h>
@@ -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);