hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/tools/perf/util/call-path.c
....@@ -1,22 +1,14 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * call-path.h: Manipulate a tree data structure containing function call paths
34 * Copyright (c) 2014, Intel Corporation.
4
- *
5
- * This program is free software; you can redistribute it and/or modify it
6
- * under the terms and conditions of the GNU General Public License,
7
- * version 2, as published by the Free Software Foundation.
8
- *
9
- * This program is distributed in the hope it will be useful, but WITHOUT
10
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
- * more details.
13
- *
145 */
156
167 #include <linux/rbtree.h>
178 #include <linux/list.h>
9
+#include <linux/zalloc.h>
10
+#include <stdlib.h>
1811
19
-#include "util.h"
2012 #include "call-path.h"
2113
2214 static void call_path__init(struct call_path *cp, struct call_path *parent,
....@@ -48,7 +40,7 @@
4840 struct call_path_block *pos, *n;
4941
5042 list_for_each_entry_safe(pos, n, &cpr->blocks, node) {
51
- list_del(&pos->node);
43
+ list_del_init(&pos->node);
5244 free(pos);
5345 }
5446 free(cpr);