lkml.org 
[lkml]   [2020]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/2] checks: Improve i2c reg property checking
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
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2020-05-28 10:32    [W:0.061 / U:9.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site