mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Joel Stanley <joel@jms.id.au>
Cc: devicetree-compiler@vger.kernel.org,
	David Gibson <david@gibson.dropbear.id.au>,
	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 18:31:15 +1000	[thread overview]
Message-ID: <20200528183115.05b2519a@canb.auug.org.au> (raw)
In-Reply-To: <20200528072037.1402346-3-joel@jms.id.au>

[-- Attachment #1: Type: text/plain, Size: 721 bytes --]

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))

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-05-28  8:31 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 [this message]
2020-05-28  8:44     ` Joel Stanley

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=20200528183115.05b2519a@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=arnd@arndb.de \
    --cc=david@gibson.dropbear.id.au \
    --cc=devicetree-compiler@vger.kernel.org \
    --cc=joel@jms.id.au \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®