Re: [PATCH v1] drm: bridge: dw_hdmi: Fix constant truncation warning on phy_mask
"Luca Ceresoli" <[email protected]>
| Newsgroups | org.freedesktop.lists.dri-devel,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
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