Skip to contentSkip to conversation

drm/bridge: tda998x: Return NULL instead of 0 in tda998x_edid_read()

PATCH Applied Kory Maincent 2 participants 3 messages Apr 17 – May 4

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/bridge: tda998x: Return NULL instead of 0 in tda998x_edid_read()

From: "Kory Maincent (TI)" <[email protected]>

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")
---
 drivers/gpu/drm/bridge/tda998x_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/tda998x_drv.c +1 -1
index 779b976f601c1..6c427bc75896b 100644
@@ -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);
Signature · 1 line
2.43.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Kory Maincent

From: "Kory Maincent (TI)" <[email protected]>

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"

Quoted 6 lines

Replace 0 with NULL to fix the sparse warning.

Fixes c76a8be4feec ("drm/bridge: tda998x: Add support for DRM_BRIDGE_ATTACH_NO_CONNECTOR")

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

reviewer Applied
#2 lore raw
In reply to Kory Maincent
Quoted 8 lines · Kory Maincent

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,

Signature · 1 line
Luca Ceresoli <[email protected]>