History

ktime: Get rid of the union

ktime is a union because the initial implementation stored the time in scalar nanoseconds on 64 bit machine and in a endianess optimized timespec variant for 32bit machines. The Y2038 cleanup removed the timespec variant and switched everything to scalar nanoseconds. The union remained, but become completely pointless. Get rid of the union and just keep ktime_t as simple typedef of type s64. The conversion was done with coccinelle and some manual mopping up.

Thomas Gleixner committed 9 years ago

Commit 2456e851 parent a5a1d1c48 files · +200 −227Browse files

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

Unified · Split

lib/timerqueue.c+2−2
@@ -48,7 +48,7 @@ bool timerqueue_add(struct timerqueue_head *head, struct timerqueue_node *node) · 47 unmodified lines
48 while (*p) {48 while (*p) {
49 parent = *p;49 parent = *p;
50 ptr = rb_entry(parent, struct timerqueue_node, node);50 ptr = rb_entry(parent, struct timerqueue_node, node);
51 if (node->expires.tv64 < ptr->expires.tv64)51 if (node->expires < ptr->expires)
52 p = &(*p)->rb_left;52 p = &(*p)->rb_left;
53 else53 else
54 p = &(*p)->rb_right;54 p = &(*p)->rb_right;
@@ -56,7 +56,7 @@ bool timerqueue_add(struct timerqueue_head *head, struct timerqueue_node *node) · 1 unmodified line
56 rb_link_node(&node->node, parent, p);56 rb_link_node(&node->node, parent, p);
57 rb_insert_color(&node->node, &head->head);57 rb_insert_color(&node->node, &head->head);
58 58
59 if (!head->next || node->expires.tv64 < head->next->expires.tv64) {59 if (!head->next || node->expires < head->next->expires) {
60 head->next = node;60 head->next = node;
61 return true;61 return true;
62 }62 }