Skip to content

Commit a0ae950

Browse files
Zhen LeiKAGA-KOKO
authored andcommitted
debugobjects: Delete a piece of redundant code
The statically allocated objects are all located in obj_static_pool[], the whole memory of obj_static_pool[] will be reclaimed later. Therefore, there is no need to split the remaining statically nodes in list obj_pool into isolated ones, no one will use them anymore. Just write INIT_HLIST_HEAD(&obj_pool) is enough. Since hlist_move_list() directly discards the old list, even this can be omitted. Signed-off-by: Zhen Lei <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/all/[email protected] Link: https://lore.kernel.org/all/[email protected]
1 parent 9852d85 commit a0ae950

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/debugobjects.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,10 +1325,10 @@ static int __init debug_objects_replace_static_objects(void)
13251325
* active object references.
13261326
*/
13271327

1328-
/* Remove the statically allocated objects from the pool */
1329-
hlist_for_each_entry_safe(obj, tmp, &obj_pool, node)
1330-
hlist_del(&obj->node);
1331-
/* Move the allocated objects to the pool */
1328+
/*
1329+
* Replace the statically allocated objects list with the allocated
1330+
* objects list.
1331+
*/
13321332
hlist_move_list(&objects, &obj_pool);
13331333

13341334
/* Replace the active object references */

0 commit comments

Comments
 (0)