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 <[email protected]>

Reviewed-by: Luca Ceresoli <[email protected]>

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

Reply via email to