Skip to contentSkip to conversation

drm/msm: check for equals 0 only

PATCH In review Nicholas Mc Guire 3 participants 3 messages Apr 25, 2019 – Apr 26, 2019

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

PATCH 1/1 drm/msm: check for equals 0 only

wait_for_completion_timeout() returns 0 on timeout and aleast 1 otherwise so checking for < makes no sense here.

---

Problem located with an experimental coccinelle script

While this check does no harm in this form - it should be fixed anyway to comply with the API see: kernel/sched/completion.c

Also noticed that get_maintainer.pl will not list [email protected] when run on drivers/gpu/drm/msm/dsi/dsi_host.c - is that intentional ?

Patch was compile-tested with: qcom_defconfig (implies DRM_MSM_DSI=y)

Patch is against v5.1-rc6 (localversion-next is next-20190424)

 drivers/gpu/drm/msm/dsi/dsi_host.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/msm/dsi/dsi_host.c +1 -1
index 610183d..dc16067 100644
@@ -1049,7 +1049,7 @@ static void dsi_wait4video_done(struct msm_dsi_host *msm_host)
 	ret = wait_for_completion_timeout(&msm_host->video_comp,
 			msecs_to_jiffies(70));
 
-	if (ret <= 0)
+	if (ret == 0)
 		DRM_DEV_ERROR(dev, "wait for video done timed out\n");
 
 	dsi_intr_ctrl(msm_host, DSI_IRQ_MASK_VIDEO_DONE, 0);
Signature · 1 line
2.1.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Nicholas Mc Guire

wait_for_completion_timeout() returns 0 on timeout and aleast 1 otherwise so checking for < makes no sense here.

Quoted 31 lines

---

Problem located with an experimental coccinelle script

While this check does no harm in this form - it should be fixed anyway to comply with the API see: kernel/sched/completion.c

Also noticed that get_maintainer.pl will not list [email protected] when run on drivers/gpu/drm/msm/dsi/dsi_host.c - is that intentional ?

Patch was compile-tested with: qcom_defconfig (implies DRM_MSM_DSI=y)

Patch is against v5.1-rc6 (localversion-next is next-20190424)

 drivers/gpu/drm/msm/dsi/dsi_host.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/msm/dsi/dsi_host.c +1 -1
index 610183d..dc16067 100644
@@ -1049,7 +1049,7 @@ static void dsi_wait4video_done(struct
 msm_dsi_host *msm_host)
 	ret = wait_for_completion_timeout(&msm_host->video_comp,
 			msecs_to_jiffies(70));
 
-	if (ret <= 0)
+	if (ret == 0)
 		DRM_DEV_ERROR(dev, "wait for video done timed out\n");
 
Quoted 1 line

dsi_intr_ctrl(msm_host, DSI_IRQ_MASK_VIDEO_DONE, 0);

_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno

#2 lore raw
In reply to Nicholas Mc Guire
Quoted 7 lines · Nicholas Mc Guire

wait_for_completion_timeout() returns 0 on timeout and aleast 1 otherwise so checking for < makes no sense here.

---

Quoted 7 lines

Problem located with an experimental coccinelle script

While this check does no harm in this form - it should be fixed anyway to comply with the API see: kernel/sched/completion.c

Also noticed that get_maintainer.pl will not list [email protected] when run on drivers/gpu/drm/msm/dsi/dsi_host.c - is that intentional ?

Thanks, I'll pull this in for -fixes

as far as get_maintainer.pl.. I'm not entirely sure.. we don't list [email protected] explicitly, but neither do a lot of the other driver entries. Possibly this is a oversight in the MAINTAINERS entry? Either way, I guess I'd say that it isn't intentional.

BR,
-R

Quoted 24 lines

Patch was compile-tested with: qcom_defconfig (implies DRM_MSM_DSI=y)

Patch is against v5.1-rc6 (localversion-next is next-20190424)

 drivers/gpu/drm/msm/dsi/dsi_host.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/msm/dsi/dsi_host.c +1 -2
index 610183d..dc16067 100644
@@ -1049,7 +1049,7 @@ static void dsi_wait4video_done(struct msm_dsi_host *msm_host)
        ret = wait_for_completion_timeout(&msm_host->video_comp,
                        msecs_to_jiffies(70));
 
-       if (ret <= 0)
+       if (ret == 0)
                DRM_DEV_ERROR(dev, "wait for video done timed out\n");
 
        dsi_intr_ctrl(msm_host, DSI_IRQ_MASK_VIDEO_DONE, 0);
--

2.1.4