* Move element from its current position in the list to the tail position in * the same list. * * Undefined behaviour if 'node' is not already part of the list. */
| 401 | * Undefined behaviour if 'node' is not already part of the list. |
| 402 | */ |
| 403 | static inline void |
| 404 | dlist_move_tail(dlist_head *head, dlist_node *node) |
| 405 | { |
| 406 | /* fast path if it's already at the tail */ |
| 407 | if (head->head.prev == node) |
| 408 | return; |
| 409 | |
| 410 | dlist_delete(node); |
| 411 | dlist_push_tail(head, node); |
| 412 | |
| 413 | dlist_check(head); |
| 414 | } |
| 415 | |
| 416 | /* |
| 417 | * Check whether 'node' has a following node. |
no test coverage detected