Lines Matching +full:t +full:- +full:head
1 // SPDX-License-Identifier: GPL-2.0-only
15 * printk() is not safe in MCE context. This is a lock-less memory allocator
16 * used to save error information organized in a lock-less list.
29 * Compare the record "t" with each of the records on list "l" to see if
32 static bool is_duplicate_mce_record(struct mce_evt_llist *t, struct mce_evt_llist *l) in is_duplicate_mce_record() argument
37 m1 = &t->mce; in is_duplicate_mce_record()
39 llist_for_each_entry(node, &l->llnode, llnode) { in is_duplicate_mce_record()
40 m2 = &node->mce; in is_duplicate_mce_record()
49 * The system has panicked - we'd like to peruse the list of MCE records
57 struct llist_node *head; in mce_gen_pool_prepare_records() local
59 struct mce_evt_llist *node, *t; in mce_gen_pool_prepare_records() local
61 head = llist_del_all(&mce_event_llist); in mce_gen_pool_prepare_records()
62 if (!head) in mce_gen_pool_prepare_records()
66 llist_for_each_entry_safe(node, t, head, llnode) { in mce_gen_pool_prepare_records()
67 if (!is_duplicate_mce_record(node, t)) in mce_gen_pool_prepare_records()
68 llist_add(&node->llnode, &new_head); in mce_gen_pool_prepare_records()
76 struct llist_node *head; in mce_gen_pool_process() local
80 head = llist_del_all(&mce_event_llist); in mce_gen_pool_process()
81 if (!head) in mce_gen_pool_process()
84 head = llist_reverse_order(head); in mce_gen_pool_process()
85 llist_for_each_entry_safe(node, tmp, head, llnode) { in mce_gen_pool_process()
86 mce = &node->mce; in mce_gen_pool_process()
102 return -EINVAL; in mce_gen_pool_add()
105 return -EINVAL; in mce_gen_pool_add()
110 return -ENOMEM; in mce_gen_pool_add()
113 memcpy(&node->mce, mce, sizeof(*mce)); in mce_gen_pool_add()
114 llist_add(&node->llnode, &mce_event_llist); in mce_gen_pool_add()
123 int ret = -ENOMEM; in mce_gen_pool_create()
127 gpool = gen_pool_create(order, -1); in mce_gen_pool_create()
138 ret = gen_pool_add(gpool, (unsigned long)mce_pool, mce_poolsz, -1); in mce_gen_pool_create()