From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Sasha Levin <sashal@kernel.org>,
Chun-Kuang Hu <chunkuang.hu@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Chunfeng Yun <chunfeng.yun@mediatek.com>,
Vinod Koul <vkoul@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
Nathan Chancellor <nathan@kernel.org>,
Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Cc: Neil Armstrong <neil.armstrong@linaro.org>,
Manivannan Sadhasivam <mani@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
dri-devel@lists.freedesktop.org,
linux-mediatek@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev
Subject: Re: [PATCH] phy: phy-mtk-dp: Fix pdata array members initialized as pointers
Date: Mon, 14 Sep 2026 10:18:21 +0200 [thread overview]
Message-ID: <e28acd6b-aac6-4e2e-8d0b-b9ed22820d73@collabora.com> (raw)
In-Reply-To: <20260913172930.1150324-1-sashal@kernel.org>
On 9/13/26 19:29, Sasha Levin wrote:
> Building arm/arm64/i386 allmodconfig with clang fails:
>
> drivers/phy/mediatek/phy-mtk-dp.c:761:18: error: incompatible pointer
> to integer conversion initializing 'u16' (aka 'unsigned short') with
> an expression of type 'const u16[4]' [-Wint-conversion]
> drivers/phy/mediatek/phy-mtk-dp.c:761:18: error: initializer element
> is not a compile-time constant
> drivers/phy/mediatek/phy-mtk-dp.c:761:18: error: suggest braces around
> initialization of subobject [-Werror,-Wmissing-braces]
>
> 14 errors in total, one set per offending member.
>
> off_ana_lane, off_dig_lane and driving_params are declared as arrays in
> struct mtk_dp_phy_pdata:
>
> u16 off_ana_lane[MTK_DP_PHY_MAX_LANES];
> u16 off_dig_lane[MTK_DP_PHY_MAX_LANES];
> u32 driving_params[PHYD_DIG_NUM_DRV_PARA_REGS];
>
> but the SoC data instances initialize them with compound literals. A
> compound literal is an object, not an initializer list, so this is not
> an array initializer: the member is initialized element-wise from a
> scalar, the first element gets the address of the literal truncated to
> u16/u32, and the remaining elements are zeroed. Hence the three
> diagnostics above - the pointer-to-integer conversion, the address not
> being a compile-time constant, and the missing braces.
>
> Arrays are the right type here, since both members are indexed per lane
> and driving_params is sized with ARRAY_SIZE(), so drop the casts and use
> plain braced initializers.
>
> Found by KernelCI builds of the linus-next tree.
>
> Fixes: ae859204b519 ("phy: phy-mtk-dp: Migrate register offsets to SoC specific pdata")
> Fixes: 7cf38eb0ab59 ("phy: phy-mtk-dp: Add support for digital and analog calibration")
> Fixes: 6fe4d5beac72 ("phy: phy-mtk-dp: Add support for MT8196 eDP PHY")
> Assisted-by: LLM
> Signed-off-by: Sasha Levin <sashal@kernel.org>
Whoops, sorry.
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
WARNING: multiple messages have this Message-ID (diff)
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Sasha Levin <sashal@kernel.org>,
Chun-Kuang Hu <chunkuang.hu@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Chunfeng Yun <chunfeng.yun@mediatek.com>,
Vinod Koul <vkoul@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
Nathan Chancellor <nathan@kernel.org>,
Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Cc: Neil Armstrong <neil.armstrong@linaro.org>,
Manivannan Sadhasivam <mani@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
dri-devel@lists.freedesktop.org,
linux-mediatek@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev
Subject: Re: [PATCH] phy: phy-mtk-dp: Fix pdata array members initialized as pointers
Date: Mon, 14 Sep 2026 10:18:21 +0200 [thread overview]
Message-ID: <e28acd6b-aac6-4e2e-8d0b-b9ed22820d73@collabora.com> (raw)
In-Reply-To: <20260913172930.1150324-1-sashal@kernel.org>
On 9/13/26 19:29, Sasha Levin wrote:
> Building arm/arm64/i386 allmodconfig with clang fails:
>
> drivers/phy/mediatek/phy-mtk-dp.c:761:18: error: incompatible pointer
> to integer conversion initializing 'u16' (aka 'unsigned short') with
> an expression of type 'const u16[4]' [-Wint-conversion]
> drivers/phy/mediatek/phy-mtk-dp.c:761:18: error: initializer element
> is not a compile-time constant
> drivers/phy/mediatek/phy-mtk-dp.c:761:18: error: suggest braces around
> initialization of subobject [-Werror,-Wmissing-braces]
>
> 14 errors in total, one set per offending member.
>
> off_ana_lane, off_dig_lane and driving_params are declared as arrays in
> struct mtk_dp_phy_pdata:
>
> u16 off_ana_lane[MTK_DP_PHY_MAX_LANES];
> u16 off_dig_lane[MTK_DP_PHY_MAX_LANES];
> u32 driving_params[PHYD_DIG_NUM_DRV_PARA_REGS];
>
> but the SoC data instances initialize them with compound literals. A
> compound literal is an object, not an initializer list, so this is not
> an array initializer: the member is initialized element-wise from a
> scalar, the first element gets the address of the literal truncated to
> u16/u32, and the remaining elements are zeroed. Hence the three
> diagnostics above - the pointer-to-integer conversion, the address not
> being a compile-time constant, and the missing braces.
>
> Arrays are the right type here, since both members are indexed per lane
> and driving_params is sized with ARRAY_SIZE(), so drop the casts and use
> plain braced initializers.
>
> Found by KernelCI builds of the linus-next tree.
>
> Fixes: ae859204b519 ("phy: phy-mtk-dp: Migrate register offsets to SoC specific pdata")
> Fixes: 7cf38eb0ab59 ("phy: phy-mtk-dp: Add support for digital and analog calibration")
> Fixes: 6fe4d5beac72 ("phy: phy-mtk-dp: Add support for MT8196 eDP PHY")
> Assisted-by: LLM
> Signed-off-by: Sasha Levin <sashal@kernel.org>
Whoops, sorry.
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
next prev parent reply other threads:[~2026-09-14 8:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-13 17:29 [PATCH] phy: phy-mtk-dp: Fix pdata array members initialized as pointers Sasha Levin
2026-09-13 17:29 ` Sasha Levin
2026-09-14 8:18 ` AngeloGioacchino Del Regno [this message]
2026-09-14 8:18 ` AngeloGioacchino Del Regno
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=e28acd6b-aac6-4e2e-8d0b-b9ed22820d73@collabora.com \
--to=angelogioacchino.delregno@collabora.com \
--cc=chunfeng.yun@mediatek.com \
--cc=chunkuang.hu@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=justinstitt@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-phy@lists.infradead.org \
--cc=llvm@lists.linux.dev \
--cc=mani@kernel.org \
--cc=manivannan.sadhasivam@oss.qualcomm.com \
--cc=matthias.bgg@gmail.com \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=neil.armstrong@linaro.org \
--cc=p.zabel@pengutronix.de \
--cc=sashal@kernel.org \
--cc=vkoul@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.