All of lore.kernel.org
 help / color / mirror / Atom feed
* re: drm/exynos: consider deferred probe case
@ 2014-06-10 12:38 Dan Carpenter
  2014-06-11  6:12 ` Inki Dae
  0 siblings, 1 reply; 6+ messages in thread
From: Dan Carpenter @ 2014-06-10 12:38 UTC (permalink / raw)
  To: inki.dae; +Cc: linux-samsung-soc

Hello Inki Dae,

The patch df5225bc9a87: "drm/exynos: consider deferred probe case"
from May 29, 2014, leads to the following static checker warning:

	drivers/gpu/drm/exynos/exynos_drm_fimd.c:996 fimd_probe()
	warn: 'ctx->display' isn't an ERR_PTR

drivers/gpu/drm/exynos/exynos_drm_fimd.c
   994  
   995          ctx->display = exynos_dpi_probe(dev);
   996          if (IS_ERR(ctx->display))
   997                  return PTR_ERR(ctx->display);
   998  

Smatch is complaining because my config has CONFIG_DRM_EXYNOS_DPI
disabled.

1) If CONFIG_DRM_EXYNOS_DPI isn't enabled, we still return "0".  That
will cause a Sparse warning.

2) Also there are still a number of checks for "if (ctx->display)".
Those things are weird to me, are those checks to see
CONFIG_DRM_EXYNOS_DPI is enabled or are they checking that
exynos_dpi_probe() succeeded?

regards,
dan carpenter

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

* Re: drm/exynos: consider deferred probe case
  2014-06-10 12:38 drm/exynos: consider deferred probe case Dan Carpenter
@ 2014-06-11  6:12 ` Inki Dae
  2014-06-11  6:36     ` Dan Carpenter
  0 siblings, 1 reply; 6+ messages in thread
From: Inki Dae @ 2014-06-11  6:12 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-samsung-soc


Hello Dan,

On 2014년 06월 10일 21:38, Dan Carpenter wrote:
> Hello Inki Dae,
> 
> The patch df5225bc9a87: "drm/exynos: consider deferred probe case"
> from May 29, 2014, leads to the following static checker warning:
> 
> 	drivers/gpu/drm/exynos/exynos_drm_fimd.c:996 fimd_probe()
> 	warn: 'ctx->display' isn't an ERR_PTR
> 
> drivers/gpu/drm/exynos/exynos_drm_fimd.c
>    994  
>    995          ctx->display = exynos_dpi_probe(dev);
>    996          if (IS_ERR(ctx->display))
>    997                  return PTR_ERR(ctx->display);
>    998  
> 
> Smatch is complaining because my config has CONFIG_DRM_EXYNOS_DPI
> disabled.
> 
> 1) If CONFIG_DRM_EXYNOS_DPI isn't enabled, we still return "0".  That
> will cause a Sparse warning.
>

It would be no problem. This code will return PTR_ERR(ctx->dislay) only
in case that dpi module is enabled.

> 2) Also there are still a number of checks for "if (ctx->display)".
> Those things are weird to me, are those checks to see
> CONFIG_DRM_EXYNOS_DPI is enabled or are they checking that
> exynos_dpi_probe() succeeded?
> 

Right. crtc driver, fimd, needs encoder/connector objects. In Exynos drm
case, encoder/connector can be created by dpi module for parallel panel,
by dsi module for mipi dsi based panel, or by dp module for eDP based panel.

So if some board has a parallel panel, encoder/connector objects will be
created by dpi module, and then fimd module will refer to ctx->display
object to control the parallel panel device. Otherwise, dsi or dp
modules will create encoder/connector objects in its driver, and one of
them will use its own display object to control corresponding panel device.

Thanks,
Inki Dae

> regards,
> dan carpenter
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

* [patch] drm/exynos: change zero to NULL for sparse
  2014-06-11  6:12 ` Inki Dae
@ 2014-06-11  6:36     ` Dan Carpenter
  0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2014-06-11  6:36 UTC (permalink / raw)
  To: Inki Dae, Andrzej Hajda
  Cc: Joonyoung Shim, Seung-Woo Kim, Kyungmin Park, Kukjin Kim,
	linux-samsung-soc, kernel-janitors

We recently changed this function to return a pointer instead of an int
so we need to change this zero to a NULL or Sparse complains:

	drivers/gpu/drm/exynos/exynos_drm_drv.h:346:47:
	warning: Using plain integer as NULL pointer

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index 36535f3..06cde45 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
@@ -343,7 +343,7 @@ struct exynos_drm_display * exynos_dpi_probe(struct device *dev);
 int exynos_dpi_remove(struct device *dev);
 #else
 static inline struct exynos_drm_display *
-exynos_dpi_probe(struct device *dev) { return 0; }
+exynos_dpi_probe(struct device *dev) { return NULL; }
 static inline int exynos_dpi_remove(struct device *dev) { return 0; }
 #endif
 

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

* [patch] drm/exynos: change zero to NULL for sparse
@ 2014-06-11  6:36     ` Dan Carpenter
  0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2014-06-11  6:36 UTC (permalink / raw)
  To: Inki Dae, Andrzej Hajda
  Cc: Joonyoung Shim, Seung-Woo Kim, Kyungmin Park, Kukjin Kim,
	linux-samsung-soc, kernel-janitors

We recently changed this function to return a pointer instead of an int
so we need to change this zero to a NULL or Sparse complains:

	drivers/gpu/drm/exynos/exynos_drm_drv.h:346:47:
	warning: Using plain integer as NULL pointer

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index 36535f3..06cde45 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
@@ -343,7 +343,7 @@ struct exynos_drm_display * exynos_dpi_probe(struct device *dev);
 int exynos_dpi_remove(struct device *dev);
 #else
 static inline struct exynos_drm_display *
-exynos_dpi_probe(struct device *dev) { return 0; }
+exynos_dpi_probe(struct device *dev) { return NULL; }
 static inline int exynos_dpi_remove(struct device *dev) { return 0; }
 #endif
 

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

* Re: [patch] drm/exynos: change zero to NULL for sparse
  2014-06-11  6:36     ` Dan Carpenter
@ 2014-06-18  5:06       ` Inki Dae
  -1 siblings, 0 replies; 6+ messages in thread
From: Inki Dae @ 2014-06-18  5:06 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Andrzej Hajda, Joonyoung Shim, Seung-Woo Kim, Kyungmin Park,
	Kukjin Kim, linux-samsung-soc, kernel-janitors

On 2014년 06월 11일 15:36, Dan Carpenter wrote:
> We recently changed this function to return a pointer instead of an int
> so we need to change this zero to a NULL or Sparse complains:
> 
> 	drivers/gpu/drm/exynos/exynos_drm_drv.h:346:47:
> 	warning: Using plain integer as NULL pointer

Applied.

Thanks,
Inki Dae

> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h
> index 36535f3..06cde45 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
> @@ -343,7 +343,7 @@ struct exynos_drm_display * exynos_dpi_probe(struct device *dev);
>  int exynos_dpi_remove(struct device *dev);
>  #else
>  static inline struct exynos_drm_display *
> -exynos_dpi_probe(struct device *dev) { return 0; }
> +exynos_dpi_probe(struct device *dev) { return NULL; }
>  static inline int exynos_dpi_remove(struct device *dev) { return 0; }
>  #endif
>  
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


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

* Re: [patch] drm/exynos: change zero to NULL for sparse
@ 2014-06-18  5:06       ` Inki Dae
  0 siblings, 0 replies; 6+ messages in thread
From: Inki Dae @ 2014-06-18  5:06 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Andrzej Hajda, Joonyoung Shim, Seung-Woo Kim, Kyungmin Park,
	Kukjin Kim, linux-samsung-soc, kernel-janitors

On 2014년 06월 11일 15:36, Dan Carpenter wrote:
> We recently changed this function to return a pointer instead of an int
> so we need to change this zero to a NULL or Sparse complains:
> 
> 	drivers/gpu/drm/exynos/exynos_drm_drv.h:346:47:
> 	warning: Using plain integer as NULL pointer

Applied.

Thanks,
Inki Dae

> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h
> index 36535f3..06cde45 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
> @@ -343,7 +343,7 @@ struct exynos_drm_display * exynos_dpi_probe(struct device *dev);
>  int exynos_dpi_remove(struct device *dev);
>  #else
>  static inline struct exynos_drm_display *
> -exynos_dpi_probe(struct device *dev) { return 0; }
> +exynos_dpi_probe(struct device *dev) { return NULL; }
>  static inline int exynos_dpi_remove(struct device *dev) { return 0; }
>  #endif
>  
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2014-06-18  5:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-10 12:38 drm/exynos: consider deferred probe case Dan Carpenter
2014-06-11  6:12 ` Inki Dae
2014-06-11  6:36   ` [patch] drm/exynos: change zero to NULL for sparse Dan Carpenter
2014-06-11  6:36     ` Dan Carpenter
2014-06-18  5:06     ` Inki Dae
2014-06-18  5:06       ` Inki Dae

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.