All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] v4l2-of: fix compiler errors if CONFIG_OF is undefined
@ 2015-04-28  6:41 Hans Verkuil
  2015-04-28  8:23 ` Sakari Ailus
  0 siblings, 1 reply; 2+ messages in thread
From: Hans Verkuil @ 2015-04-28  6:41 UTC (permalink / raw)
  To: Linux Media Mailing List, Sakari Ailus

You must use static inline otherwise you get these errors if CONFIG_OF is not defined:

In file included from drivers/media/platform/soc_camera/soc_camera.c:39:0:
include/media/v4l2-of.h:112:13: warning: 'v4l2_of_free_endpoint' defined but not used [-Wunused-function]
 static void v4l2_of_free_endpoint(struct v4l2_of_endpoint *endpoint)
             ^
In file included from drivers/media/platform/soc_camera/atmel-isi.c:28:0:
include/media/v4l2-of.h:112:13: warning: 'v4l2_of_free_endpoint' defined but not used [-Wunused-function]
 static void v4l2_of_free_endpoint(struct v4l2_of_endpoint *endpoint)
             ^
In file included from drivers/media/platform/soc_camera/rcar_vin.c:36:0:
include/media/v4l2-of.h:112:13: warning: 'v4l2_of_free_endpoint' defined but not used [-Wunused-function]
 static void v4l2_of_free_endpoint(struct v4l2_of_endpoint *endpoint)
             ^

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
diff --git a/include/media/v4l2-of.h b/include/media/v4l2-of.h
index 241e98a..4dc34b2 100644
--- a/include/media/v4l2-of.h
+++ b/include/media/v4l2-of.h
@@ -103,13 +103,13 @@ static inline int v4l2_of_parse_endpoint(const struct device_node *node,
 	return -ENOSYS;
 }
 
-struct v4l2_of_endpoint *v4l2_of_alloc_parse_endpoint(
+static inline struct v4l2_of_endpoint *v4l2_of_alloc_parse_endpoint(
 	const struct device_node *node)
 {
 	return NULL;
 }
 
-static void v4l2_of_free_endpoint(struct v4l2_of_endpoint *endpoint)
+static inline void v4l2_of_free_endpoint(struct v4l2_of_endpoint *endpoint)
 {
 }
 

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

* Re: [PATCH] v4l2-of: fix compiler errors if CONFIG_OF is undefined
  2015-04-28  6:41 [PATCH] v4l2-of: fix compiler errors if CONFIG_OF is undefined Hans Verkuil
@ 2015-04-28  8:23 ` Sakari Ailus
  0 siblings, 0 replies; 2+ messages in thread
From: Sakari Ailus @ 2015-04-28  8:23 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: Linux Media Mailing List

Hi Hans,

On Tue, Apr 28, 2015 at 08:41:00AM +0200, Hans Verkuil wrote:
> You must use static inline otherwise you get these errors if CONFIG_OF is not defined:
> 
> In file included from drivers/media/platform/soc_camera/soc_camera.c:39:0:
> include/media/v4l2-of.h:112:13: warning: 'v4l2_of_free_endpoint' defined but not used [-Wunused-function]
>  static void v4l2_of_free_endpoint(struct v4l2_of_endpoint *endpoint)
>              ^
> In file included from drivers/media/platform/soc_camera/atmel-isi.c:28:0:
> include/media/v4l2-of.h:112:13: warning: 'v4l2_of_free_endpoint' defined but not used [-Wunused-function]
>  static void v4l2_of_free_endpoint(struct v4l2_of_endpoint *endpoint)
>              ^
> In file included from drivers/media/platform/soc_camera/rcar_vin.c:36:0:
> include/media/v4l2-of.h:112:13: warning: 'v4l2_of_free_endpoint' defined but not used [-Wunused-function]
>  static void v4l2_of_free_endpoint(struct v4l2_of_endpoint *endpoint)
>              ^
> 
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> ---
> diff --git a/include/media/v4l2-of.h b/include/media/v4l2-of.h
> index 241e98a..4dc34b2 100644
> --- a/include/media/v4l2-of.h
> +++ b/include/media/v4l2-of.h
> @@ -103,13 +103,13 @@ static inline int v4l2_of_parse_endpoint(const struct device_node *node,
>  	return -ENOSYS;
>  }
>  
> -struct v4l2_of_endpoint *v4l2_of_alloc_parse_endpoint(
> +static inline struct v4l2_of_endpoint *v4l2_of_alloc_parse_endpoint(
>  	const struct device_node *node)
>  {
>  	return NULL;
>  }
>  
> -static void v4l2_of_free_endpoint(struct v4l2_of_endpoint *endpoint)
> +static inline void v4l2_of_free_endpoint(struct v4l2_of_endpoint *endpoint)
>  {
>  }
>  

Oops. My bad. Thanks for the patch!

Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>

-- 
Sakari Ailus
e-mail: sakari.ailus@iki.fi	XMPP: sailus@retiisi.org.uk

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

end of thread, other threads:[~2015-04-28  8:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-28  6:41 [PATCH] v4l2-of: fix compiler errors if CONFIG_OF is undefined Hans Verkuil
2015-04-28  8:23 ` Sakari Ailus

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.