Re: [PATCH] drm/bridge/synopsys: avoid field overflow warning

From: Arnd Bergmann
Date: Wed Apr 09 2025 - 03:08:01 EST


On Tue, Apr 8, 2025, at 19:51, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@xxxxxxxx>
>
> clang-16 and earlier complain about what it thinks might be an out of
> range number:
>
> drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi2.c:348:8: error: call to
> __compiletime_assert_579 declared with 'error' attribute: FIELD_PREP:
> value too large for the field
> PHY_SYS_RATIO(tmp));
> ^
> drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi2.c:90:27: note: expanded
> from macro 'PHY_SYS_RATIO'
> #define PHY_SYS_RATIO(x) FIELD_PREP(GENMASK(16, 0), x)
>

I still see the same build failure in some other configurations even
with this patch. Please disregard this version, I'll try to come
up with a better one.

Arnd