[lkml]   [2018]   [May]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v7 3/7] drivers/i2c: Add port structure to FSI algorithm

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

Thanks Ben. My mistake on this one; I misread the macro. I will remove
the check in v9... going to wait a little for any further comments now.


> Cheers,
> Ben.

 \ /
  Last update: 2018-05-31 16:19    [W:0.110 / U:2.628 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site