mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/bridge: tda998x: Return NULL instead of 0 in tda998x_edid_read()
@ 2026-04-17 15:54 Kory Maincent
  2026-04-17 16:12 ` Luca Ceresoli
  2026-05-04 14:59 ` Luca Ceresoli
  0 siblings, 2 replies; 3+ messages in thread
From: Kory Maincent @ 2026-04-17 15:54 UTC (permalink / raw)
  To: Luca Ceresoli, Kory Maincent (TI.com),
	Jyri Sarha, Russell King, dri-devel, linux-kernel
  Cc: Bajjuri Praneeth, kernel test robot, thomas.petazzoni,
	Russell King, Andrzej Hajda, Neil Armstrong, Robert Foss,
	Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter

From: "Kory Maincent (TI)" <kory.maincent@bootlin.com>

tda998x_edid_read() returns a const struct drm_edid pointer, but when
tda998x_edid_delay_wait() fails (process killed while waiting for the
HPD timeout), the integer literal 0 is returned instead of NULL,
triggering a sparse warning: "Using plain integer as NULL pointer"

Replace 0 with NULL to fix the sparse warning.

Fixes: c76a8be4feec ("drm/bridge: tda998x: Add support for DRM_BRIDGE_ATTACH_NO_CONNECTOR")
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 779b976f601c1..6c427bc75896b 100644
--- a/drivers/gpu/drm/bridge/tda998x_drv.c
+++ b/drivers/gpu/drm/bridge/tda998x_drv.c
@@ -1293,7 +1293,7 @@ static const struct drm_edid *tda998x_edid_read(struct tda998x_priv *priv,
 	 * can't handle signals gracefully.
 	 */
 	if (tda998x_edid_delay_wait(priv))
-		return 0;
+		return NULL;
 
 	if (priv->rev == TDA19988)
 		reg_clear(priv, REG_TX4, TX4_PD_RAM);
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/bridge: tda998x: Return NULL instead of 0 in tda998x_edid_read()
  2026-04-17 15:54 [PATCH] drm/bridge: tda998x: Return NULL instead of 0 in tda998x_edid_read() Kory Maincent
@ 2026-04-17 16:12 ` Luca Ceresoli
  2026-05-04 14:59 ` Luca Ceresoli
  1 sibling, 0 replies; 3+ messages in thread
From: Luca Ceresoli @ 2026-04-17 16:12 UTC (permalink / raw)
  To: Kory Maincent, Jyri Sarha, Russell King, dri-devel, linux-kernel
  Cc: Bajjuri Praneeth, kernel test robot, thomas.petazzoni,
	Russell King, Andrzej Hajda, Neil Armstrong, Robert Foss,
	Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter

On Fri Apr 17, 2026 at 5:54 PM CEST, Kory Maincent wrote:
> From: "Kory Maincent (TI)" <kory.maincent@bootlin.com>
>
> tda998x_edid_read() returns a const struct drm_edid pointer, but when
> tda998x_edid_delay_wait() fails (process killed while waiting for the
> HPD timeout), the integer literal 0 is returned instead of NULL,
> triggering a sparse warning: "Using plain integer as NULL pointer"
>
> Replace 0 with NULL to fix the sparse warning.
>
> Fixes: c76a8be4feec ("drm/bridge: tda998x: Add support for DRM_BRIDGE_ATTACH_NO_CONNECTOR")
> 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>

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

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/bridge: tda998x: Return NULL instead of 0 in tda998x_edid_read()
  2026-04-17 15:54 [PATCH] drm/bridge: tda998x: Return NULL instead of 0 in tda998x_edid_read() Kory Maincent
  2026-04-17 16:12 ` Luca Ceresoli
@ 2026-05-04 14:59 ` Luca Ceresoli
  1 sibling, 0 replies; 3+ messages in thread
From: Luca Ceresoli @ 2026-05-04 14:59 UTC (permalink / raw)
  To: Jyri Sarha, Russell King, dri-devel, linux-kernel, Kory Maincent
  Cc: Bajjuri Praneeth, kernel test robot, thomas.petazzoni,
	Russell King, Andrzej Hajda, Neil Armstrong, Robert Foss,
	Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter


On Fri, 17 Apr 2026 17:54:45 +0200, Kory Maincent wrote:
> tda998x_edid_read() returns a const struct drm_edid pointer, but when
> tda998x_edid_delay_wait() fails (process killed while waiting for the
> HPD timeout), the integer literal 0 is returned instead of NULL,
> triggering a sparse warning: "Using plain integer as NULL pointer"
> 
> Replace 0 with NULL to fix the sparse warning.
> 
> [...]

Applied, thanks!

[1/1] drm/bridge: tda998x: Return NULL instead of 0 in tda998x_edid_read()
      commit: b5d0ad616ca8dd8c7b6b24dc13012e342278a085

Best regards,
-- 
Luca Ceresoli <luca.ceresoli@bootlin.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-05-04 14:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-04-17 15:54 [PATCH] drm/bridge: tda998x: Return NULL instead of 0 in tda998x_edid_read() Kory Maincent
2026-04-17 16:12 ` Luca Ceresoli
2026-05-04 14:59 ` Luca Ceresoli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome