drivers/gpu/drm/bridge/tda998x_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
From: "Kory Maincent (TI)" <kory.maincent@bootlin.com>
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 *.
Fixes: 7e567624dc5a4 ("drm/i2c: tda998x: Register ASoC hdmi-codec and add audio DT binding")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202604172257.Imo6GOH9-lkp@intel.com/
Signed-off-by: Kory Maincent (TI) <kory.maincent@bootlin.com>
---
drivers/gpu/drm/bridge/tda998x_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/bridge/tda998x_drv.c b/drivers/gpu/drm/bridge/tda998x_drv.c
index d9b388165de15..779b976f601c1 100644
--- a/drivers/gpu/drm/bridge/tda998x_drv.c
+++ b/drivers/gpu/drm/bridge/tda998x_drv.c
@@ -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;
--
2.43.0
On Fri, Apr 17, 2026 at 05:55:44PM +0200, Kory Maincent wrote:
> From: "Kory Maincent (TI)" <kory.maincent@bootlin.com>
>
> 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 *.
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.
> Fixes: 7e567624dc5a4 ("drm/i2c: tda998x: Register ASoC hdmi-codec and add audio DT binding")
This is correct.
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202604172257.Imo6GOH9-lkp@intel.com/
This also look scorrect.
> Signed-off-by: Kory Maincent (TI) <kory.maincent@bootlin.com>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Thanks!
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
On Mon, Apr 27, 2026 at 09:33:19PM +0100, Russell King (Oracle) wrote: > > Reported-by: kernel test robot <lkp@intel.com> > > Closes: https://lore.kernel.org/oe-kbuild-all/202604172257.Imo6GOH9-lkp@intel.com/ > > 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. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
On Fri Apr 17, 2026 at 5:55 PM CEST, Kory Maincent wrote:
> From: "Kory Maincent (TI)" <kory.maincent@bootlin.com>
>
> 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.
> 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 *.
>
> Fixes: 7e567624dc5a4 ("drm/i2c: tda998x: Register ASoC hdmi-codec and add audio DT binding")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202604172257.Imo6GOH9-lkp@intel.com/
Wrong link?
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
On Fri, 17 Apr 2026 18:19:03 +0200
"Luca Ceresoli" <luca.ceresoli@bootlin.com> wrote:
> On Fri Apr 17, 2026 at 5:55 PM CEST, Kory Maincent wrote:
> > From: "Kory Maincent (TI)" <kory.maincent@bootlin.com>
> >
> > 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.
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.
> > 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 *.
> >
> > Fixes: 7e567624dc5a4 ("drm/i2c: tda998x: Register ASoC hdmi-codec and add
> > audio DT binding") Reported-by: kernel test robot <lkp@intel.com>
> > Closes:
> > https://lore.kernel.org/oe-kbuild-all/202604172257.Imo6GOH9-lkp@intel.com/
>
> 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,
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
© 2016 - 2026 Red Hat, Inc.