Re: [RFC/PATCH v3 5/7] v4l: subdev: Uninline the v4l2_subdev_init function

2010-08-04 Thread Hans Verkuil
On Monday 12 July 2010 17:25:50 Laurent Pinchart wrote:
> The function isn't small or performance sensitive enough to be inlined.
> 
> Signed-off-by: Laurent Pinchart 

Acked-by: Hans Verkuil 

> ---
>  drivers/media/video/v4l2-subdev.c |   14 ++
>  include/media/v4l2-subdev.h   |   15 ++-
>  2 files changed, 16 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/media/video/v4l2-subdev.c 
> b/drivers/media/video/v4l2-subdev.c
> index 424c9c2..052dc9c 100644
> --- a/drivers/media/video/v4l2-subdev.c
> +++ b/drivers/media/video/v4l2-subdev.c
> @@ -63,3 +63,17 @@ const struct v4l2_file_operations v4l2_subdev_fops = {
>   .unlocked_ioctl = subdev_ioctl,
>   .release = subdev_close,
>  };
> +
> +void v4l2_subdev_init(struct v4l2_subdev *sd, const struct v4l2_subdev_ops 
> *ops)
> +{
> + INIT_LIST_HEAD(&sd->list);
> + BUG_ON(!ops);
> + sd->ops = ops;
> + sd->v4l2_dev = NULL;
> + sd->flags = 0;
> + sd->name[0] = '\0';
> + sd->grp_id = 0;
> + sd->priv = NULL;
> + sd->initialized = 1;
> +}
> +EXPORT_SYMBOL(v4l2_subdev_init);
> diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
> index dc0ccd3..9ee45c8 100644
> --- a/include/media/v4l2-subdev.h
> +++ b/include/media/v4l2-subdev.h
> @@ -444,19 +444,8 @@ static inline void *v4l2_get_subdevdata(const struct 
> v4l2_subdev *sd)
>   return sd->priv;
>  }
>  
> -static inline void v4l2_subdev_init(struct v4l2_subdev *sd,
> - const struct v4l2_subdev_ops *ops)
> -{
> - INIT_LIST_HEAD(&sd->list);
> - BUG_ON(!ops);
> - sd->ops = ops;
> - sd->v4l2_dev = NULL;
> - sd->flags = 0;
> - sd->name[0] = '\0';
> - sd->grp_id = 0;
> - sd->priv = NULL;
> - sd->initialized = 1;
> -}
> +void v4l2_subdev_init(struct v4l2_subdev *sd,
> +   const struct v4l2_subdev_ops *ops);
>  
>  /* Call an ops of a v4l2_subdev, doing the right checks against
> NULL pointers.
> 

-- 
Hans Verkuil - video4linux developer - sponsored by TANDBERG, part of Cisco
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC/PATCH v3 5/7] v4l: subdev: Uninline the v4l2_subdev_init function

2010-07-12 Thread Laurent Pinchart
The function isn't small or performance sensitive enough to be inlined.

Signed-off-by: Laurent Pinchart 
---
 drivers/media/video/v4l2-subdev.c |   14 ++
 include/media/v4l2-subdev.h   |   15 ++-
 2 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/drivers/media/video/v4l2-subdev.c 
b/drivers/media/video/v4l2-subdev.c
index 424c9c2..052dc9c 100644
--- a/drivers/media/video/v4l2-subdev.c
+++ b/drivers/media/video/v4l2-subdev.c
@@ -63,3 +63,17 @@ const struct v4l2_file_operations v4l2_subdev_fops = {
.unlocked_ioctl = subdev_ioctl,
.release = subdev_close,
 };
+
+void v4l2_subdev_init(struct v4l2_subdev *sd, const struct v4l2_subdev_ops 
*ops)
+{
+   INIT_LIST_HEAD(&sd->list);
+   BUG_ON(!ops);
+   sd->ops = ops;
+   sd->v4l2_dev = NULL;
+   sd->flags = 0;
+   sd->name[0] = '\0';
+   sd->grp_id = 0;
+   sd->priv = NULL;
+   sd->initialized = 1;
+}
+EXPORT_SYMBOL(v4l2_subdev_init);
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index dc0ccd3..9ee45c8 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -444,19 +444,8 @@ static inline void *v4l2_get_subdevdata(const struct 
v4l2_subdev *sd)
return sd->priv;
 }
 
-static inline void v4l2_subdev_init(struct v4l2_subdev *sd,
-   const struct v4l2_subdev_ops *ops)
-{
-   INIT_LIST_HEAD(&sd->list);
-   BUG_ON(!ops);
-   sd->ops = ops;
-   sd->v4l2_dev = NULL;
-   sd->flags = 0;
-   sd->name[0] = '\0';
-   sd->grp_id = 0;
-   sd->priv = NULL;
-   sd->initialized = 1;
-}
+void v4l2_subdev_init(struct v4l2_subdev *sd,
+ const struct v4l2_subdev_ops *ops);
 
 /* Call an ops of a v4l2_subdev, doing the right checks against
NULL pointers.
-- 
1.7.1

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