static struct tdma_job *do_reply_cal_job(struct tdma_priv *tdma, struct tdma_reply_cal *job, rtdm_lockctx_t lockctx) { struct tdma_job *prev_job; if (job->reply_cycle > tdma->current_cycle) return &job->head; /* remove the job */ __list_del(job->head.entry.prev, job->head.entry.next); job->head.ref_count--; prev_job = tdma->current_job = list_entry(job->head.entry.prev, struct tdma_job, entry); prev_job->ref_count++; tdma->job_list_revision++; rtdm_lock_put_irqrestore(&tdma->lock, lockctx); if (job->reply_cycle == tdma->current_cycle) { /* send reply in the assigned slot */ rtdm_task_sleep_abs(tdma->current_cycle_start + job->reply_offset, RTDM_TIMERMODE_REALTIME); rtmac_xmit(job->reply_rtskb); } else { /* cleanup if cycle already passed */ kfree_rtskb(job->reply_rtskb); } rtdm_lock_get_irqsave(&tdma->lock, lockctx); return prev_job; }
/** * list_move_tail - delete from one list and add as another's tail * @list: the entry to move * @head: the head that will follow our entry */ void list_move_tail(struct list_head* list, struct list_head* head) { __check_head(head); __list_del(list->prev, list->next); list_add_tail(list, head); }
static inline void detach_timer(struct timer_list *timer, bool clear_pending) { struct list_head *entry = &timer->entry; __list_del(entry->prev, entry->next); if (clear_pending) entry->next = NULL; entry->prev = LIST_POISON2; }
static void info_list_destroy(struct list_head *head) { struct list_head *curr, *next; for (curr = head->next; curr != head;) { next = curr->next; // get next pointer now since we're freeing the memory __list_del(curr->prev, curr->next); info_free(to_info(curr)); curr = next; } }
static inline void detach_timer(struct tti_timer_list *timer, int clear_pending) { struct list_head *entry = &timer->entry; debug_deactivate(timer); __list_del(entry->prev, entry->next); if (clear_pending) entry->next = NULL; entry->prev = LIST_POISON2; }
/** * list_del - deletes entry from list. * @entry: the element to delete from the list. * Note: list_empty on entry does not return true after this, the entry is * in an undefined state. */ void list_del(struct list_head *entry) { if(entry->prev->next != entry) { printf("list_del corruption. prev->next should be %p, " "but was %p\n", entry, entry->prev->next); assert(0); } if(entry->next->prev != entry) { printf("list_del corruption. next->prev should be %p, " "but was %p\n", entry, entry->next->prev); assert(0); } __list_del(entry->prev, entry->next); entry->next = (struct list_head *)LIST_POISON1; entry->prev = (struct list_head *)LIST_POISON2; }
static struct tdma_job *do_request_cal_job(struct tdma_priv *tdma, struct tdma_request_cal *job, rtdm_lockctx_t lockctx) { struct rt_proc_call *call; struct tdma_job *prev_job; int err; if ((job->period != 1) && (tdma->current_cycle % job->period != job->phasing)) return &job->head; /* remove job until we get a reply */ __list_del(job->head.entry.prev, job->head.entry.next); job->head.ref_count--; prev_job = tdma->current_job = list_entry(job->head.entry.prev, struct tdma_job, entry); prev_job->ref_count++; tdma->job_list_revision++; rtdm_lock_put_irqrestore(&tdma->lock, lockctx); rtdm_task_sleep_abs(tdma->current_cycle_start + job->offset, RTDM_TIMERMODE_REALTIME); err = tdma_xmit_request_cal_frame(tdma, tdma->current_cycle + job->period, job->offset); rtdm_lock_get_irqsave(&tdma->lock, lockctx); /* terminate call on error */ if (err < 0) { call = tdma->calibration_call; tdma->calibration_call = NULL; if (call) { rtdm_lock_put_irqrestore(&tdma->lock, lockctx); rtpc_complete_call(call, err); rtdm_lock_get_irqsave(&tdma->lock, lockctx); } } return prev_job; }
int del_mtd_partitions(struct mtd_info *master) { struct list_head *node; struct mtd_part *slave; for (node = mtd_partitions.next; node != &mtd_partitions; node = node->next) { slave = list_entry(node, struct mtd_part, list); if (slave->master == master) { struct list_head *prev = node->prev; __list_del(prev, node->next); del_mtd_device(&slave->mtd); kfree(slave); node = prev; } } return 0; }
static inline void list_del(struct list_head *entry) { __list_del(entry->prev, entry->next); }
/** * list_del_init - deletes entry from list and reinitialize it. * @entry: the element to delete from the list. */ void list_del_init(struct list_head* entry) { __list_del(entry->prev, entry->next); INIT_LIST_HEAD(entry); }
static inline void list_delete(list_node_t * entry) { __list_del(entry->prev, entry->next); }
/** ****************************************************************************** * @brief 删除节点 * @param[in] *pHead : * @retval None * * @details * * @note ****************************************************************************** */ void ListDelNode(struct ListNode *pNode) { __list_del(pNode->pPrevNode, pNode->pNextNode); }
static void _list_del(struct list *const entry) { assert(entry->prev->next == entry); assert(entry->next->prev == entry); __list_del(entry->prev, entry->next); }
void tlist::remove(list_node * entry){ __list_del(entry->prev, entry->next); delete entry; }
void tlist::move_head(list_node * entry){ __list_del(entry->prev, entry->next); __list_add(entry, m_head, m_head->next); }