linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joel Stanley <joel@jms.id.au>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Devicetree Compiler <devicetree-compiler@vger.kernel.org>,
	David Gibson <david@gibson.dropbear.id.au>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH v2 2/2] checks: Improve i2c reg property checking
Date: Thu, 28 May 2020 08:44:52 +0000	[thread overview]
Message-ID: <CACPK8XeXt3fzrMiq4=+8k9+9t2am4k=YZLJ4FUYkn2k1=2AMsQ@mail.gmail.com> (raw)
In-Reply-To: <20200528183115.05b2519a@canb.auug.org.au>

On Thu, 28 May 2020 at 08:31, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Hi Joel,
>
> On Thu, 28 May 2020 16:50:37 +0930 Joel Stanley <joel@jms.id.au> wrote:
> >
> >
> >  #define I2C_OWN_SLAVE_ADDRESS        (1 << 30)
> > +#define I2C_TEN_BIT_ADDRESS  (1 << 31)
> >
> >  static void check_i2c_bus_reg(struct check *c, struct dt_info *dti, struct node *node)
> >  {
> > @@ -1057,10 +1058,13 @@ static void check_i2c_bus_reg(struct check *c, struct dt_info *dti, struct node
> >               reg = fdt32_to_cpu(*(cells++));
> >               /* Ignore I2C_OWN_SLAVE_ADDRESS */
> >               reg &= ~I2C_OWN_SLAVE_ADDRESS;
> > -             if (reg > 0x3ff)
> > +
> > +             if ((reg & I2C_TEN_BIT_ADDRESS) && reg > 0x3ff)
>
> Shouldn't this be
>
>                 if ((reg & I2C_TEN_BIT_ADDRESS) && ((reg & ~I2C_TEN_BIT_ADDRESS) > 0x3ff))

Yes, good catch.

There are no device trees that set the I2C_TEN_BIT_ADDRESS flag in the
kernel, so it is untested.

      reply	other threads:[~2020-05-28  8:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28  7:20 [PATCH v2 0/2] dtc: Improve checks for i2c reg properties Joel Stanley
2020-05-28  7:20 ` [PATCH v2 1/2] checks: Remove warning for I2C_OWN_SLAVE_ADDRESS Joel Stanley
2020-05-28  7:20 ` [PATCH v2 2/2] checks: Improve i2c reg property checking Joel Stanley
2020-05-28  8:31   ` Stephen Rothwell
2020-05-28  8:44     ` Joel Stanley [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACPK8XeXt3fzrMiq4=+8k9+9t2am4k=YZLJ4FUYkn2k1=2AMsQ@mail.gmail.com' \
    --to=joel@jms.id.au \
    --cc=arnd@arndb.de \
    --cc=david@gibson.dropbear.id.au \
    --cc=devicetree-compiler@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).