The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Luca Ceresoli" <luca.ceresoli@bootlin.com>
To: "Sean Chang" <seanwascoding@gmail.com>,
	"Andrzej Hajda" <andrzej.hajda@intel.com>,
	"Neil Armstrong" <neil.armstrong@linaro.org>,
	"Robert Foss" <rfoss@kernel.org>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>
Cc: "Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>,
	"Jonas Karlman" <jonas@kwiboo.se>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"Luca Ceresoli" <luca.ceresoli@bootlin.com>,
	"Liu Ying" <victor.liu@nxp.com>,
	"Jani Nikula" <jani.nikula@intel.com>,
	"Shengjiu Wang" <shengjiu.wang@nxp.com>,
	"Javier Martinez Canillas" <javierm@redhat.com>,
	<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1] drm: bridge: dw_hdmi: Fix constant truncation warning on phy_mask
Date: Tue, 25 Aug 2026 12:29:29 +0200	[thread overview]
Message-ID: <DKXYDGIP3KRX.3AJ5KBX7VI2M7@bootlin.com> (raw)
In-Reply-To: <20260819151216.56833-1-seanwascoding@gmail.com>

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@gmail.com>

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

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

      reply	other threads:[~2026-08-25 10:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-19 15:12 [PATCH v1] drm: bridge: dw_hdmi: Fix constant truncation warning on phy_mask Sean Chang
2026-08-25 10:29 ` Luca Ceresoli [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DKXYDGIP3KRX.3AJ5KBX7VI2M7@bootlin.com \
    --to=luca.ceresoli@bootlin.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=javierm@redhat.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=seanwascoding@gmail.com \
    --cc=shengjiu.wang@nxp.com \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    --cc=victor.liu@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox