drm/bridge: tda998x: Use __be32 for audio port OF property pointer
PATCH 1/1 drm/bridge: tda998x: Use __be32 for audio port OF property pointer
From: "Kory Maincent (TI)" <[email protected]>
of_get_property() returns a pointer to big-endian (__be32) data, but port_data in tda998x_get_audio_ports() was declared as const u32 *, causing a sparse endianness type mismatch warning. Fix the declaration to use const __be32 *.
--- drivers/gpu/drm/bridge/tda998x_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/tda998x_drv.c +1 -1
@@ -1762,7 +1762,7 @@ static const struct drm_bridge_funcs tda998x_bridge_funcs = {static int tda998x_get_audio_ports (struct tda998x_priv *priv,struct device_node *np) { -const u32 *port_data; +const __be32 *port_data;u32 size;int i;
Signature · 1 line
2.43.0
Luca Ceresoli
reviewerQuoted 3 lines · Kory Maincent
From: "Kory Maincent (TI)" <[email protected]>
of_get_property()returns a pointer to big-endian (__be32) data, but
Where is this stated? of_get_property() is declared as:
| extern const void *of_get_property(const struct device_node *node, | const char *name, | int *lenp);
(https://elixir.bootlin.com/linux/v7.0/source/include/linux/of.h#L365-L367)
I don't see __be32 mentioned there.
Quoted 7 lines
port_dataintda998x_get_audio_ports()was declared as const u32 *, causing a sparse endianness type mismatch warning. Fix the declaration to use const__be32*.Fixes 7e567624dc5a4 ("drm/i2c: tda998x: Register ASoC hdmi-codec and add audio DT binding")Reported-by kernel test robot <[email protected]>
Wrong link?
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Quoted 5 lines · On Fri, 17 Apr 2026 18:19:03 +0200 "Luca Ceresoli" <[email protected]>…
Quoted 3 lines · Kory Maincent
From: "Kory Maincent (TI)" <[email protected]>
of_get_property()returns a pointer to big-endian (__be32) data, but
Quoted 8 lines
Where is this stated?
of_get_property()is declared as:| extern const void *of_get_property(const struct device_node *node, | const char *name, | int *lenp);(https://elixir.bootlin.com/linux/v7.0/source/include/linux/of.h#L365-L367)
I don't see
__be32mentioned there.
It is not stated in the declaration as we don't know the property type but OF value are always in Big Endian.
And the value is converted later to u8 here:
https://elixir.bootlin.com/linux/v7.0/source/drivers/gpu/drm/bridge/tda998x_drv.c#L1719
Maybe my commit message is a bit inaccurate on this. I can rephrase it if needed.
Quoted 10 lines
Quoted 8 lines
port_dataintda998x_get_audio_ports()was declared as const u32 *, causing a sparse endianness type mismatch warning. Fix the declaration to use const__be32*.Fixes 7e567624dc5a4 ("drm/i2c: tda998x: Register ASoC hdmi-codec and addaudio DT binding") Reported-by: kernel test robot <[email protected]> Closes:
https://lore.kernel.org/oe-kbuild-all/[email protected]/Wrong link?
No, it's just that I fixed the second sparse warnings reported by the kernel test robot, but maybe quoting this link is wrong.
Regards,
Signature · 3 lines
Köry Maincent, Bootlin Embedded Linux and kernel engineering https://bootlin.com
Quoted 6 lines · Kory Maincent
From: "Kory Maincent (TI)" <[email protected]>
of_get_property()returns a pointer to big-endian (__be32) data, butport_dataintda998x_get_audio_ports()was declared as const u32 *, causing a sparse endianness type mismatch warning. Fix the declaration to use const__be32*.
This is correct.
drivers/of/fdt.c::populate_properties() assigns pp->value to point into the flattened device tree's data, and the native data format is big endian.
pp->value = (__be32 *)val;
This pointer is returned by of_get_property().
port_data is read using be32_to_cpup().
So, yes, port_data should have been a __be32 pointer.
Quoted 1 line
Fixes 7e567624dc5a4 ("drm/i2c: tda998x: Register ASoC hdmi-codec and add audio DT binding")
This is correct.
Quoted 2 lines
This also look scorrect.
Quoted 1 line
Signed-off-by Kory Maincent (TI) <[email protected]>
Thanks!
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Russell King (Oracle)
maintainerQuoted 4 lines · Russell King (Oracle)
Quoted 2 lines
This also look scorrect.
Actually, no, this isn't correct. Although this contains the warnings for the u32 vs __be32 on lines 1784..1785, this report is actually for a problem on line 1296, which is using 0 as a return value in a function returning a pointer.
Please omit this, or alternatively replace it with the correct LKP report that's associated with this particular problem.
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!