History

timers: Add rb_init_node() to allow for stack allocated rb nodes

In cases where a timerqueue_node or some structure that utilizes a timerqueue_node is allocated on the stack, gcc would give warnings caused by the timerqueue_init()'s calling RB_CLEAR_NODE, which self-references the nodes uninitialized data. The solution is to create an rb_init_node() function that zeros the rb_node structure out and then calls RB_CLEAR_NODE(), and then call the new init function from timerqueue_init().

John Stultz committed 15 years ago

Commit 88d19cf1 parent 304529b2 files · +9 −1Browse files

Showing the changes to include/linux/timerqueue.h (1 of 2 files). Show all

Unified · Split

include/linux/timerqueue.h+1−1
@@ -39,7 +39,7 @@ struct timerqueue_node *timerqueue_getnext(struct timerqueue_head *head) · 38 unmodified lines
3939
4040 static inline void timerqueue_init(struct timerqueue_node *node)
4141 {
42− RB_CLEAR_NODE(&node->node);
42+ rb_init_node(&node->node);
4343 }
4444
4545 static inline void timerqueue_init_head(struct timerqueue_head *head)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t