diff mbox series

drm/panel: make drm_panel.h self-contained

Message ID 20190627110103.7539-1-jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/panel: make drm_panel.h self-contained | expand

Commit Message

Jani Nikula June 27, 2019, 11:01 a.m. UTC
Fix build warning if drm_panel.h is built with CONFIG_OF=n or
CONFIG_DRM_PANEL=n and included without the prerequisite err.h:

./include/drm/drm_panel.h: In function ‘of_drm_find_panel’:
./include/drm/drm_panel.h:203:9: error: implicit declaration of function ‘ERR_PTR’ [-Werror=implicit-function-declaration]
  return ERR_PTR(-ENODEV);
         ^~~~~~~
./include/drm/drm_panel.h:203:9: error: returning ‘int’ from a function with return type ‘struct drm_panel *’ makes pointer from integer without a cast [-Werror=int-conversion]
  return ERR_PTR(-ENODEV);
         ^~~~~~~~~~~~~~~~

Fixes: 5fa8e4a22182 ("drm/panel: Make of_drm_find_panel() return an ERR_PTR() instead of NULL")
Cc: Boris Brezillon <boris.brezillon@bootlin.com>
Cc: Thierry Reding <treding@nvidia.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

---

I don't know if there's a combo where this actually fails, so I'm not
adding cc: stable. It's just something I hit when playing with other
code.
---
 include/drm/drm_panel.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Thierry Reding June 27, 2019, 12:31 p.m. UTC | #1
On Thu, Jun 27, 2019 at 02:01:03PM +0300, Jani Nikula wrote:
> Fix build warning if drm_panel.h is built with CONFIG_OF=n or
> CONFIG_DRM_PANEL=n and included without the prerequisite err.h:
> 
> ./include/drm/drm_panel.h: In function ‘of_drm_find_panel’:
> ./include/drm/drm_panel.h:203:9: error: implicit declaration of function ‘ERR_PTR’ [-Werror=implicit-function-declaration]
>   return ERR_PTR(-ENODEV);
>          ^~~~~~~
> ./include/drm/drm_panel.h:203:9: error: returning ‘int’ from a function with return type ‘struct drm_panel *’ makes pointer from integer without a cast [-Werror=int-conversion]
>   return ERR_PTR(-ENODEV);
>          ^~~~~~~~~~~~~~~~
> 
> Fixes: 5fa8e4a22182 ("drm/panel: Make of_drm_find_panel() return an ERR_PTR() instead of NULL")
> Cc: Boris Brezillon <boris.brezillon@bootlin.com>
> Cc: Thierry Reding <treding@nvidia.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> 
> ---
> 
> I don't know if there's a combo where this actually fails, so I'm not
> adding cc: stable. It's just something I hit when playing with other
> code.
> ---
>  include/drm/drm_panel.h | 1 +
>  1 file changed, 1 insertion(+)

Acked-by: Thierry Reding <treding@nvidia.com>
Sam Ravnborg June 30, 2019, 8:16 a.m. UTC | #2
Hi Jani.

On Thu, Jun 27, 2019 at 02:01:03PM +0300, Jani Nikula wrote:
> Fix build warning if drm_panel.h is built with CONFIG_OF=n or
> CONFIG_DRM_PANEL=n and included without the prerequisite err.h:
> 
> ./include/drm/drm_panel.h: In function ‘of_drm_find_panel’:
> ./include/drm/drm_panel.h:203:9: error: implicit declaration of function ‘ERR_PTR’ [-Werror=implicit-function-declaration]
>   return ERR_PTR(-ENODEV);
>          ^~~~~~~
> ./include/drm/drm_panel.h:203:9: error: returning ‘int’ from a function with return type ‘struct drm_panel *’ makes pointer from integer without a cast [-Werror=int-conversion]
>   return ERR_PTR(-ENODEV);
>          ^~~~~~~~~~~~~~~~
> 
> Fixes: 5fa8e4a22182 ("drm/panel: Make of_drm_find_panel() return an ERR_PTR() instead of NULL")
> Cc: Boris Brezillon <boris.brezillon@bootlin.com>
> Cc: Thierry Reding <treding@nvidia.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

When we start to deploy headers-test I expect us to find many more of
this class of issues.
But lets get them fixed so we do not see sporadic build errors due
to missing dependencies in the header files.

I assume you will commit the fix.

	Sam
Jani Nikula Aug. 1, 2019, 9:09 a.m. UTC | #3
On Sun, 30 Jun 2019, Sam Ravnborg <sam@ravnborg.org> wrote:
> Hi Jani.
>
> On Thu, Jun 27, 2019 at 02:01:03PM +0300, Jani Nikula wrote:
>> Fix build warning if drm_panel.h is built with CONFIG_OF=n or
>> CONFIG_DRM_PANEL=n and included without the prerequisite err.h:
>> 
>> ./include/drm/drm_panel.h: In function ‘of_drm_find_panel’:
>> ./include/drm/drm_panel.h:203:9: error: implicit declaration of function ‘ERR_PTR’ [-Werror=implicit-function-declaration]
>>   return ERR_PTR(-ENODEV);
>>          ^~~~~~~
>> ./include/drm/drm_panel.h:203:9: error: returning ‘int’ from a function with return type ‘struct drm_panel *’ makes pointer from integer without a cast [-Werror=int-conversion]
>>   return ERR_PTR(-ENODEV);
>>          ^~~~~~~~~~~~~~~~
>> 
>> Fixes: 5fa8e4a22182 ("drm/panel: Make of_drm_find_panel() return an ERR_PTR() instead of NULL")
>> Cc: Boris Brezillon <boris.brezillon@bootlin.com>
>> Cc: Thierry Reding <treding@nvidia.com>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
>
> When we start to deploy headers-test I expect us to find many more of
> this class of issues.
> But lets get them fixed so we do not see sporadic build errors due
> to missing dependencies in the header files.
>
> I assume you will commit the fix.

Thanks for picking up the ball I dropped, and committing this!

BR,
Jani.
diff mbox series

Patch

diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h
index 8c738c0e6e9f..26377836141c 100644
--- a/include/drm/drm_panel.h
+++ b/include/drm/drm_panel.h
@@ -24,6 +24,7 @@ 
 #ifndef __DRM_PANEL_H__
 #define __DRM_PANEL_H__
 
+#include <linux/err.h>
 #include <linux/errno.h>
 #include <linux/list.h>