ARM64: dts: rk3399: adjust idle-cost-data of EAS with idle state
[firefly-linux-kernel-4.4.55.git] / kernel / gcov / fs.c
index 27e12ce30e7dc248fd6e3f9c2d005ac044907b30..edf67c493a8e1132b79e24128c8cdea5ca85fe4d 100644 (file)
@@ -74,8 +74,8 @@ static int __init gcov_persist_setup(char *str)
 {
        unsigned long val;
 
-       if (strict_strtoul(str, 0, &val)) {
-               pr_warning("invalid gcov_persist parameter '%s'\n", str);
+       if (kstrtoul(str, 0, &val)) {
+               pr_warn("invalid gcov_persist parameter '%s'\n", str);
                return 0;
        }
        gcov_persist = val;
@@ -365,7 +365,7 @@ static const char *deskew(const char *basename)
  */
 static void add_links(struct gcov_node *node, struct dentry *parent)
 {
-       char *basename;
+       const char *basename;
        char *target;
        int num;
        int i;
@@ -381,10 +381,9 @@ static void add_links(struct gcov_node *node, struct dentry *parent)
                                &gcov_link[i]);
                if (!target)
                        goto out_err;
-               basename = strrchr(target, '/');
-               if (!basename)
+               basename = kbasename(target);
+               if (basename == target)
                        goto out_err;
-               basename++;
                node->links[i] = debugfs_create_symlink(deskew(basename),
                                                        parent, target);
                if (!node->links[i])
@@ -451,7 +450,7 @@ static struct gcov_node *new_node(struct gcov_node *parent,
        } else
                node->dentry = debugfs_create_dir(node->name, parent->dentry);
        if (!node->dentry) {
-               pr_warning("could not create file\n");
+               pr_warn("could not create file\n");
                kfree(node);
                return NULL;
        }
@@ -464,7 +463,7 @@ static struct gcov_node *new_node(struct gcov_node *parent,
 
 err_nomem:
        kfree(node);
-       pr_warning("out of memory\n");
+       pr_warn("out of memory\n");
        return NULL;
 }
 
@@ -631,8 +630,8 @@ static void add_info(struct gcov_node *node, struct gcov_info *info)
         */
        loaded_info = kcalloc(num + 1, sizeof(struct gcov_info *), GFP_KERNEL);
        if (!loaded_info) {
-               pr_warning("could not add '%s' (out of memory)\n",
-                          gcov_info_filename(info));
+               pr_warn("could not add '%s' (out of memory)\n",
+                       gcov_info_filename(info));
                return;
        }
        memcpy(loaded_info, node->loaded_info,
@@ -645,9 +644,9 @@ static void add_info(struct gcov_node *node, struct gcov_info *info)
                 * data set replaces the copy of the last one.
                 */
                if (!gcov_info_is_compatible(node->unloaded_info, info)) {
-                       pr_warning("discarding saved data for %s "
-                                  "(incompatible version)\n",
-                                  gcov_info_filename(info));
+                       pr_warn("discarding saved data for %s "
+                               "(incompatible version)\n",
+                               gcov_info_filename(info));
                        gcov_info_free(node->unloaded_info);
                        node->unloaded_info = NULL;
                }
@@ -657,8 +656,8 @@ static void add_info(struct gcov_node *node, struct gcov_info *info)
                 * The initial one takes precedence.
                 */
                if (!gcov_info_is_compatible(node->loaded_info[0], info)) {
-                       pr_warning("could not add '%s' (incompatible "
-                                  "version)\n", gcov_info_filename(info));
+                       pr_warn("could not add '%s' (incompatible "
+                               "version)\n", gcov_info_filename(info));
                        kfree(loaded_info);
                        return;
                }
@@ -693,9 +692,9 @@ static void save_info(struct gcov_node *node, struct gcov_info *info)
        else {
                node->unloaded_info = gcov_info_dup(info);
                if (!node->unloaded_info) {
-                       pr_warning("could not save data for '%s' "
-                                  "(out of memory)\n",
-                                  gcov_info_filename(info));
+                       pr_warn("could not save data for '%s' "
+                               "(out of memory)\n",
+                               gcov_info_filename(info));
                }
        }
 }
@@ -710,8 +709,8 @@ static void remove_info(struct gcov_node *node, struct gcov_info *info)
 
        i = get_info_index(node, info);
        if (i < 0) {
-               pr_warning("could not remove '%s' (not found)\n",
-                          gcov_info_filename(info));
+               pr_warn("could not remove '%s' (not found)\n",
+                       gcov_info_filename(info));
                return;
        }
        if (gcov_persist)
@@ -750,8 +749,8 @@ void gcov_event(enum gcov_action action, struct gcov_info *info)
                if (node)
                        remove_info(node, info);
                else {
-                       pr_warning("could not remove '%s' (not found)\n",
-                                  gcov_info_filename(info));
+                       pr_warn("could not remove '%s' (not found)\n",
+                               gcov_info_filename(info));
                }
                break;
        }
@@ -785,8 +784,7 @@ static __init int gcov_fs_init(void)
 
 err_remove:
        pr_err("init failed\n");
-       if (root_node.dentry)
-               debugfs_remove(root_node.dentry);
+       debugfs_remove(root_node.dentry);
 
        return rc;
 }