linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] drm/omap: dsi: fix unreachable code in dsi_vc_send_short()
@ 2021-01-27  1:51 menglong8.dong
  2021-01-27 14:23 ` Tomi Valkeinen
  0 siblings, 1 reply; 2+ messages in thread
From: menglong8.dong @ 2021-01-27  1:51 UTC (permalink / raw)
  To: tomba, sebastian.reichel
  Cc: airlied, daniel, laurent.pinchart, dri-devel, linux-kernel,
	Menglong Dong

From: Menglong Dong <dong.menglong@zte.com.cn>

The 'r' in dsi_vc_send_short() is of type 'unsigned int', so the
'r < 0' can't be true.

Fix this by introducing a 'err' of type 'int' insteaded.

Fixes: 1ed6253856cb ("drm/omap: dsi: switch dsi_vc_send_long/short to mipi_dsi_msg")

Signed-off-by: Menglong Dong <dong.menglong@zte.com.cn>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
v2:
- remove word wrap in 'Fixes' tag
---
 drivers/gpu/drm/omapdrm/dss/dsi.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
index 8e11612f5fe1..febcc87ddfe1 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -2149,11 +2149,12 @@ static int dsi_vc_send_short(struct dsi_data *dsi, int vc,
 			     const struct mipi_dsi_msg *msg)
 {
 	struct mipi_dsi_packet pkt;
+	int err;
 	u32 r;
 
-	r = mipi_dsi_create_packet(&pkt, msg);
-	if (r < 0)
-		return r;
+	err = mipi_dsi_create_packet(&pkt, msg);
+	if (err)
+		return err;
 
 	WARN_ON(!dsi_bus_is_locked(dsi));
 
-- 
2.25.1


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

* Re: [PATCH v2] drm/omap: dsi: fix unreachable code in dsi_vc_send_short()
  2021-01-27  1:51 [PATCH v2] drm/omap: dsi: fix unreachable code in dsi_vc_send_short() menglong8.dong
@ 2021-01-27 14:23 ` Tomi Valkeinen
  0 siblings, 0 replies; 2+ messages in thread
From: Tomi Valkeinen @ 2021-01-27 14:23 UTC (permalink / raw)
  To: menglong8.dong, sebastian.reichel
  Cc: airlied, daniel, laurent.pinchart, dri-devel, linux-kernel,
	Menglong Dong

On 27/01/2021 03:51, menglong8.dong@gmail.com wrote:
> From: Menglong Dong <dong.menglong@zte.com.cn>
> 
> The 'r' in dsi_vc_send_short() is of type 'unsigned int', so the
> 'r < 0' can't be true.
> 
> Fix this by introducing a 'err' of type 'int' insteaded.
> 
> Fixes: 1ed6253856cb ("drm/omap: dsi: switch dsi_vc_send_long/short to mipi_dsi_msg")
> 
> Signed-off-by: Menglong Dong <dong.menglong@zte.com.cn>
> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> ---
> v2:
> - remove word wrap in 'Fixes' tag
> ---
>  drivers/gpu/drm/omapdrm/dss/dsi.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
> index 8e11612f5fe1..febcc87ddfe1 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
> @@ -2149,11 +2149,12 @@ static int dsi_vc_send_short(struct dsi_data *dsi, int vc,
>  			     const struct mipi_dsi_msg *msg)
>  {
>  	struct mipi_dsi_packet pkt;
> +	int err;
>  	u32 r;
>  
> -	r = mipi_dsi_create_packet(&pkt, msg);
> -	if (r < 0)
> -		return r;
> +	err = mipi_dsi_create_packet(&pkt, msg);
> +	if (err)
> +		return err;
>  
>  	WARN_ON(!dsi_bus_is_locked(dsi));
>  

Thanks! I'll apply to drm-misc-next.

 Tomi

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

end of thread, other threads:[~2021-01-27 14:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-27  1:51 [PATCH v2] drm/omap: dsi: fix unreachable code in dsi_vc_send_short() menglong8.dong
2021-01-27 14:23 ` Tomi Valkeinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).