Re: [RFC PATCH 1/3] gpio: pca953x: Replace chip type flags with a type enum

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 30, 2023 at 11:57:11PM +0200, Andy Shevchenko wrote:
> On Mon, Jan 30, 2023 at 09:59:42PM +0100, Levente Révész wrote:

...

> static_assert((PCA_TYPE_MASK + 1) >= (TYPE_MAX << 8));

Actually better

static_assert(PCA_TYPE_MASK >= ((TYPE_MAX - 1) << 8));

to prevent potential overflow if we move this field to the end of the type.

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux