On Wed, 2018-05-30 at 10:47 -0500, Eddie James wrote:
NULL is never valid for a list. It does however check for an empty listNo, list_for_each_entry does NOT check if the list is empty or if the+ if (!list_empty(&i2c->ports)) {My gosh, this is done already in list_for_each*()
first entry is NULL.
It does it implicitely in the test part of the for () statement,
checking if the next pointer points back to the head.
Cheers,
Ben.