hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/include/linux/interval_tree_generic.h
....@@ -1,20 +1,8 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 Interval Trees
34 (C) 2012 Michel Lespinasse <walken@google.com>
45
5
- This program is free software; you can redistribute it and/or modify
6
- it under the terms of the GNU General Public License as published by
7
- the Free Software Foundation; either version 2 of the License, or
8
- (at your option) any later version.
9
-
10
- This program is distributed in the hope that it will be useful,
11
- but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- GNU General Public License for more details.
14
-
15
- You should have received a copy of the GNU General Public License
16
- along with this program; if not, write to the Free Software
17
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
186
197 include/linux/interval_tree_generic.h
208 */
....@@ -42,26 +30,8 @@
4230 \
4331 /* Callbacks for augmented rbtree insert and remove */ \
4432 \
45
-static inline ITTYPE ITPREFIX ## _compute_subtree_last(ITSTRUCT *node) \
46
-{ \
47
- ITTYPE max = ITLAST(node), subtree_last; \
48
- if (node->ITRB.rb_left) { \
49
- subtree_last = rb_entry(node->ITRB.rb_left, \
50
- ITSTRUCT, ITRB)->ITSUBTREE; \
51
- if (max < subtree_last) \
52
- max = subtree_last; \
53
- } \
54
- if (node->ITRB.rb_right) { \
55
- subtree_last = rb_entry(node->ITRB.rb_right, \
56
- ITSTRUCT, ITRB)->ITSUBTREE; \
57
- if (max < subtree_last) \
58
- max = subtree_last; \
59
- } \
60
- return max; \
61
-} \
62
- \
63
-RB_DECLARE_CALLBACKS(static, ITPREFIX ## _augment, ITSTRUCT, ITRB, \
64
- ITTYPE, ITSUBTREE, ITPREFIX ## _compute_subtree_last) \
33
+RB_DECLARE_CALLBACKS_MAX(static, ITPREFIX ## _augment, \
34
+ ITSTRUCT, ITRB, ITTYPE, ITSUBTREE, ITLAST) \
6535 \
6636 /* Insert / remove interval nodes from the tree */ \
6737 \