Re: [PATCH v1] drm: bridge: dw_hdmi: Fix constant truncation warning on phy_mask

From: Luca Ceresoli

Date: Tue Aug 25 2026 - 06:30:28 EST


On Wed Aug 19, 2026 at 5:12 PM CEST, Sean Chang wrote:
> In dw_hdmi_probe(), casting the bitwise complement of (HDMI_PHY_HPD |
> HDMI_PHY_RX_SENSE) directly to u8 triggers a compiler warning
> (-Wconstant-conversion).
>
> Due to C integer promotion rules, the bitwise OR and bitwise NOT are
> evaluated as 32-bit signed integers, producing 0xFFFFFF0D before being
> cast down to u8.
>
> Fix this by explicitly masking the inverted 32-bit result with 0xFF
> to keep only the lower byte and prevent implicit upper-bit truncation.
>
> Signed-off-by: Sean Chang <seanwascoding@xxxxxxxxx>

Reviewed-by: Luca Ceresoli <luca.ceresoli@xxxxxxxxxxx>

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com