History

timerqueue: Use rb_entry_safe() instead of open-coding it

Geliang Tang committed 9 years ago

Commit d852d391 parent 9e3d6221 file · +1 −2Browse files

Showing the changes to lib/timerqueue.c (1 of 1 file). Show all

Unified · Split

lib/timerqueue.c+1−2
@@ -80,8 +80,7 @@ bool timerqueue_del(struct timerqueue_head *head, struct timerqueue_node *node) · 79 unmodified lines
8080 if (head->next == node) {
8181 struct rb_node *rbn = rb_next(&node->node);
8282
83− head->next = rbn ?
84− rb_entry(rbn, struct timerqueue_node, node) : NULL;
83+ head->next = rb_entry_safe(rbn, struct timerqueue_node, node);
8584 }
8685 rb_erase(&node->node, &head->head);
8786 RB_CLEAR_NODE(&node->node);

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