Moving the kernel to modern C
Moving the kernel to modern C
Posted Feb 24, 2022 21:11 UTC (Thu) by abatters (✭ supporter ✭, #6932)In reply to: Moving the kernel to modern C by iabervon
Parent article: Moving the kernel to modern C
It would break code that does this:
list_for_each_entry(iterator, &foo_list, list) {
if (do_something_with(iterator)) {
break;
}
}
if (list_entry_is_head(iterator, &foo_list, list)) {
// iteration finished
} else {
do_something_else_with(iterator);
}
All this "compare to head" nonsense is why I prefer regular NULL-terminated linked lists to the kernel's circular linked lists. Insert/delete may take more instructions but iteration is much easier.
