lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8aaa7fa9874bf140354964535ce5cf023012c3f4.camel@kernel.crashing.org>
Date:   Thu, 31 May 2018 07:16:00 +1000
From:   Benjamin Herrenschmidt <benh@...nel.crashing.org>
To:     Eddie James <eajames@...ux.vnet.ibm.com>,
        Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     linux-i2c <linux-i2c@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        devicetree <devicetree@...r.kernel.org>,
        Wolfram Sang <wsa@...-dreams.de>,
        Rob Herring <robh+dt@...nel.org>,
        Joel Stanley <joel@....id.au>,
        Mark Rutland <mark.rutland@....com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "Edward A. James" <eajames@...ibm.com>
Subject: Re: [PATCH v7 3/7] drivers/i2c: Add port structure to FSI algorithm

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.

Cheers,
Ben.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ