]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm: use kbasename()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Sat, 3 Nov 2012 00:42:48 +0000 (11:42 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 7 Nov 2012 04:15:26 +0000 (15:15 +1100)
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memory.c

index 609f42f93c12c6fb61556da28daa4af61b02d087..bcbc0844ed75989940fbb80179b731cf0c370153 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>
@@ -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);