lkml.org 
[lkml]   [2020]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v3 2/2] checks: Improve i2c reg property checking
On Tue, Jun 2, 2020 at 11:03 AM Serge Semin
<Sergey.Semin@baikalelectronics.ru> wrote:
> On Thu, May 28, 2020 at 06:26:50PM +0930, Joel Stanley wrote:

...

> > +#define I2C_TEN_BIT_ADDRESS (1 << 31)
>
> As Andy neatly pointed out here:
> https://lore.kernel.org/lkml/20200527133656.GV1634618@smile.fi.intel.com/
> (1 << 31) is UB.

Thanks, Serge. Yes, we have to use 1U in the definitions (for 31 is
necessary, for the rest is for the sake of consistency).

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2020-06-02 10:29    [W:0.094 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site