首先,这两个函数的定义是这样的:

#define list_for_each_entry_continue(pos, head, member)                 \
    for (pos = list_entry(pos->member.next, typeof(*pos), member);      \
         prefetch(pos->member.next), &pos->member != (head);            \
         pos = list_entry(pos->member.next, typeof(*pos), member))

 

#define list_for_each_entry_from(pos, head, member)                     \
    for (; prefetch(pos->member.next), &pos->member != (head);          \
         pos = list_entry(pos->member.next, typeof(*pos), member))

 

从定义可以看出,这两个宏只在for循环的第一个分号前存在不同,在list_for_each_entry_continue(pos, head, member)中,pos = list_entry(pos->member.next, typeof(*pos), member);

即指向了当前pos结构指针的后一个,说明遍历从pos的后一个元素开始;而在define list_for_each_entry_from(pos, head, member)没有这样的语句,则说明遍历从pos开始