]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
procfs: use kbasename()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 18 Dec 2012 00:01:25 +0000 (16:01 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 18 Dec 2012 01:15:17 +0000 (17:15 -0800)
[yongjun_wei@trendmicro.com.cn: remove duplicated include]
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/proc/proc_devtree.c

index df7dd08d439121253bb180e26ad4d7e982775adf..de20ec480fa082402f557014b285f685be4974d2 100644 (file)
@@ -195,11 +195,7 @@ void proc_device_tree_add_node(struct device_node *np,
        set_node_proc_entry(np, de);
        for (child = NULL; (child = of_get_next_child(np, child));) {
                /* Use everything after the last slash, or the full name */
-               p = strrchr(child->full_name, '/');
-               if (!p)
-                       p = child->full_name;
-               else
-                       ++p;
+               p = kbasename(child->full_name);
 
                if (duplicate_name(de, p))
                        p = fixup_name(np, de, p);