News for hackers. Stuff that matters.
Re:Applying the Linus Torvalds “Good Taste” Coding Requirement by eatbitseveryday on Wednesday October 26, 2016 @12:41PM (#12798015)
A NULL head is not an error (= empty list) and 'assert' would be better as a BUG_ON or panic if it is technically an error.
Re:Applying the Linus Torvalds “Good Taste” Coding Requirement by avip on Wednesday October 26, 2016 @03:50PM (#12799844)
It is an error though if your code SEGFAULT on NULL head (and this one does).

I wouldn't care, but if you claim to be defensive, go full monty.

Re:Applying the Linus Torvalds “Good Taste” Coding Requirement by eatbitseveryday on Wednesday October 26, 2016 @04:12PM (#12800008)
> It is an error though if your code SEGFAULT on NULL head (and this one does).

There is no "SEGFAULT" in kernel code. SIGSEGV is a signal, which is only used at user-level.

NULL dereference in the kernel results in an "oops".

I believe it is also assumed in their code that "entry" is not going to be NULL, meaning "if (head == entry)" will never succeed if head is NULL.

Re:Applying the Linus Torvalds “Good Taste” Coding Requirement by avip on Wednesday October 26, 2016 @04:31PM (#12800182)
The code crashes if head is NULL, regardless of entry.