cron job: media_tree daily build: ERRORS

2013-12-25 Thread Hans Verkuil
This message is generated daily by a cron job that builds media_tree for
the kernels and architectures in the list below.

Results of the daily build of media_tree:

date:   Thu Dec 26 04:00:35 CET 2013
git branch: test
git hash:   7d459937dc09bb8e448d9985ec4623779427d8a5
gcc version:i686-linux-gcc (GCC) 4.8.2
sparse version: 0.4.5-rc1
host hardware:  x86_64
host os:3.12-0.slh.2-amd64

linux-git-arm-at91: OK
linux-git-arm-davinci: ERRORS
linux-git-arm-exynos: OK
linux-git-arm-mx: OK
linux-git-arm-omap: OK
linux-git-arm-omap1: OK
linux-git-arm-pxa: OK
linux-git-blackfin: OK
linux-git-i686: OK
linux-git-m32r: OK
linux-git-mips: OK
linux-git-powerpc64: OK
linux-git-sh: OK
linux-git-x86_64: OK
linux-2.6.31.14-i686: WARNINGS
linux-2.6.32.27-i686: WARNINGS
linux-2.6.33.7-i686: WARNINGS
linux-2.6.34.7-i686: WARNINGS
linux-2.6.35.9-i686: WARNINGS
linux-2.6.36.4-i686: WARNINGS
linux-2.6.37.6-i686: WARNINGS
linux-2.6.38.8-i686: WARNINGS
linux-2.6.39.4-i686: WARNINGS
linux-3.0.60-i686: WARNINGS
linux-3.1.10-i686: WARNINGS
linux-3.2.37-i686: OK
linux-3.3.8-i686: OK
linux-3.4.27-i686: WARNINGS
linux-3.5.7-i686: WARNINGS
linux-3.6.11-i686: WARNINGS
linux-3.7.4-i686: WARNINGS
linux-3.8-i686: WARNINGS
linux-3.9.2-i686: WARNINGS
linux-3.10.1-i686: OK
linux-3.11.1-i686: OK
linux-3.12-i686: OK
linux-3.13-rc1-i686: OK
linux-2.6.31.14-x86_64: WARNINGS
linux-2.6.32.27-x86_64: WARNINGS
linux-2.6.33.7-x86_64: WARNINGS
linux-2.6.34.7-x86_64: WARNINGS
linux-2.6.35.9-x86_64: WARNINGS
linux-2.6.36.4-x86_64: WARNINGS
linux-2.6.37.6-x86_64: WARNINGS
linux-2.6.38.8-x86_64: WARNINGS
linux-2.6.39.4-x86_64: WARNINGS
linux-3.0.60-x86_64: WARNINGS
linux-3.1.10-x86_64: WARNINGS
linux-3.2.37-x86_64: OK
linux-3.3.8-x86_64: OK
linux-3.4.27-x86_64: WARNINGS
linux-3.5.7-x86_64: WARNINGS
linux-3.6.11-x86_64: WARNINGS
linux-3.7.4-x86_64: WARNINGS
linux-3.8-x86_64: WARNINGS
linux-3.9.2-x86_64: WARNINGS
linux-3.10.1-x86_64: WARNINGS
linux-3.11.1-x86_64: WARNINGS
linux-3.12-x86_64: WARNINGS
linux-3.13-rc1-x86_64: WARNINGS
apps: OK
spec-git: OK
sparse version: 0.4.5-rc1
sparse: ERRORS

Detailed results are available here:

http://www.xs4all.nl/~hverkuil/logs/Thursday.log

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Thursday.tar.bz2

The Media Infrastructure API from this daily build is here:

http://www.xs4all.nl/~hverkuil/spec/media.html
--
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


Re: [RFC v1.1 2/2] media: v4l: Only get module if it's different than the driver for v4l2_dev

2013-12-25 Thread Laurent Pinchart
Hi Sakari,

Thank you for the patch.

On Tuesday 17 December 2013 15:49:24 Sakari Ailus wrote:
> When the sub-device is registered, increment the use count of the sub-device
> owner only if it's different from the owner of the driver for the media
> device. This avoids increasing the use count by the module itself and thus
> making it possible to unload it when it's not in use.
>
> Signed-off-by: Sakari Ailus 

This looks good to me, but I wonder whether a more generic solution won't be 
needed, to solve the multiple circular reference issues we (will) have with 
subdevices and clocks. My gut feeling is that such a generic solution will 
also cater for the needs of the problem you're trying to solve here.

This being said, there's no reason to delay this patch until a more generic 
solution is available, so

Acked-by: Laurent Pinchart 

> ---
> Changes since v1:
> 
> - Check that v4l2_dev->dev and v4l2_dev->dev->driver are non-NULL before
>   using them.
> - Store the information on the same owner into struct v4l2_subdev. This
> avoids issues related to unregistering subdevs through
> v4l2_device_unregister().
> 
>  drivers/media/v4l2-core/v4l2-device.c | 18 +++---
>  include/media/v4l2-subdev.h   |  1 +
>  2 files changed, 16 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-device.c
> b/drivers/media/v4l2-core/v4l2-device.c index 02d1b63..015f92a 100644
> --- a/drivers/media/v4l2-core/v4l2-device.c
> +++ b/drivers/media/v4l2-core/v4l2-device.c
> @@ -158,7 +158,17 @@ int v4l2_device_register_subdev(struct v4l2_device
> *v4l2_dev, /* Warn if we apparently re-register a subdev */
>   WARN_ON(sd->v4l2_dev != NULL);
> 
> - if (!try_module_get(sd->owner))
> + /*
> +  * The reason to acquire the module here is to avoid unloading
> +  * a module of sub-device which is registered to a media
> +  * device. To make it possible to unload modules for media
> +  * devices that also register sub-devices, do not
> +  * try_module_get() such sub-device owners.
> +  */
> + sd->owner_v4l2_dev = v4l2_dev->dev && v4l2_dev->dev->driver &&
> + sd->owner == v4l2_dev->dev->driver->owner;
> +
> + if (!sd->owner_v4l2_dev && !try_module_get(sd->owner))
>   return -ENODEV;
> 
>   sd->v4l2_dev = v4l2_dev;
> @@ -192,7 +202,8 @@ error_unregister:
>   if (sd->internal_ops && sd->internal_ops->unregistered)
>   sd->internal_ops->unregistered(sd);
>  error_module:
> - module_put(sd->owner);
> + if (!sd->owner_v4l2_dev)
> + module_put(sd->owner);
>   sd->v4l2_dev = NULL;
>   return err;
>  }
> @@ -280,6 +291,7 @@ void v4l2_device_unregister_subdev(struct v4l2_subdev
> *sd) }
>  #endif
>   video_unregister_device(sd->devnode);
> - module_put(sd->owner);
> + if (!sd->owner_v4l2_dev)
> + module_put(sd->owner);
>  }
>  EXPORT_SYMBOL_GPL(v4l2_device_unregister_subdev);
> diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
> index d67210a..6d03b54 100644
> --- a/include/media/v4l2-subdev.h
> +++ b/include/media/v4l2-subdev.h
> @@ -579,6 +579,7 @@ struct v4l2_subdev {
>  #endif
>   struct list_head list;
>   struct module *owner;
> + bool owner_v4l2_dev;
>   u32 flags;
>   struct v4l2_device *v4l2_dev;
>   const struct v4l2_subdev_ops *ops;
-- 
Regards,

Laurent Pinchart

--
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


Re: [RFC 1/2] media: Use a better owner for the media device

2013-12-25 Thread Laurent Pinchart
Hi Sakari,

Thank you for the patch.

On Friday 13 December 2013 14:03:35 Sakari Ailus wrote:
> mdev->fops->owner is actually the owner of the very same module which
> implements media_device_register(), so it can't be unloaded anyway. Instead,
> use THIS_MODULE through a macro as does video_register_device().
> 
> Signed-off-by: Sakari Ailus 

This looks good to me.

Acked-by: Laurent Pinchart 

> ---
>  drivers/media/media-device.c  | 7 ---
>  drivers/media/media-devnode.c | 5 +++--
>  include/media/media-device.h  | 4 +++-
>  include/media/media-devnode.h | 3 ++-
>  4 files changed, 12 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
> index d5a7a13..51217f0 100644
> --- a/drivers/media/media-device.c
> +++ b/drivers/media/media-device.c
> @@ -372,7 +372,8 @@ static void media_device_release(struct media_devnode
> *mdev) * - dev must point to the parent device
>   * - model must be filled with the device model name
>   */
> -int __must_check media_device_register(struct media_device *mdev)
> +int __must_check __media_device_register(struct media_device *mdev,
> +  struct module *owner)
>  {
>   int ret;
> 
> @@ -388,7 +389,7 @@ int __must_check media_device_register(struct
> media_device *mdev) mdev->devnode.fops = &media_device_fops;
>   mdev->devnode.parent = mdev->dev;
>   mdev->devnode.release = media_device_release;
> - ret = media_devnode_register(&mdev->devnode);
> + ret = media_devnode_register(&mdev->devnode, owner);
>   if (ret < 0)
>   return ret;
> 
> @@ -400,7 +401,7 @@ int __must_check media_device_register(struct
> media_device *mdev)
> 
>   return 0;
>  }
> -EXPORT_SYMBOL_GPL(media_device_register);
> +EXPORT_SYMBOL_GPL(__media_device_register);
> 
>  /**
>   * media_device_unregister - unregister a media device
> diff --git a/drivers/media/media-devnode.c b/drivers/media/media-devnode.c
> index fb0f046..7acd19c 100644
> --- a/drivers/media/media-devnode.c
> +++ b/drivers/media/media-devnode.c
> @@ -232,7 +232,8 @@ static const struct file_operations media_devnode_fops =
> { * the media_devnode structure is *not* called, so the caller is
> responsible for * freeing any data.
>   */
> -int __must_check media_devnode_register(struct media_devnode *mdev)
> +int __must_check media_devnode_register(struct media_devnode *mdev,
> + struct module *owner)
>  {
>   int minor;
>   int ret;
> @@ -253,7 +254,7 @@ int __must_check media_devnode_register(struct
> media_devnode *mdev)
> 
>   /* Part 2: Initialize and register the character device */
>   cdev_init(&mdev->cdev, &media_devnode_fops);
> - mdev->cdev.owner = mdev->fops->owner;
> + mdev->cdev.owner = owner;
> 
>   ret = cdev_add(&mdev->cdev, MKDEV(MAJOR(media_dev_t), mdev->minor), 1);
>   if (ret < 0) {
> diff --git a/include/media/media-device.h b/include/media/media-device.h
> index 12155a9..6e6db78 100644
> --- a/include/media/media-device.h
> +++ b/include/media/media-device.h
> @@ -87,7 +87,9 @@ struct media_device {
>  /* media_devnode to media_device */
>  #define to_media_device(node) container_of(node, struct media_device,
> devnode)
> 
> -int __must_check media_device_register(struct media_device *mdev);
> +int __must_check __media_device_register(struct media_device *mdev,
> +  struct module *owner);
> +#define media_device_register(mdev) __media_device_register(mdev,
> THIS_MODULE) void media_device_unregister(struct media_device *mdev);
> 
>  int __must_check media_device_register_entity(struct media_device *mdev,
> diff --git a/include/media/media-devnode.h b/include/media/media-devnode.h
> index 3446af2..0dc7060 100644
> --- a/include/media/media-devnode.h
> +++ b/include/media/media-devnode.h
> @@ -82,7 +82,8 @@ struct media_devnode {
>  /* dev to media_devnode */
>  #define to_media_devnode(cd) container_of(cd, struct media_devnode, dev)
> 
> -int __must_check media_devnode_register(struct media_devnode *mdev);
> +int __must_check media_devnode_register(struct media_devnode *mdev,
> + struct module *owner);
>  void media_devnode_unregister(struct media_devnode *mdev);
> 
>  static inline struct media_devnode *media_devnode_data(struct file *filp)
-- 
Regards,

Laurent Pinchart

--
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


question about drivers/media/usb/gspca/kinect.c

2013-12-25 Thread Julia Lawall
The following code, in the function send_cmd, looks too concise:

do {
actual_len = kinect_read(udev, ibuf, 0x200);
} while (actual_len == 0);
PDEBUG(D_USBO, "Control reply: %d", res);
if (actual_len < sizeof(*rhdr)) {
pr_err("send_cmd: Input control transfer failed (%d)\n", res);
return res;
}

It seems that actual_len might be less than sizeof(*rhdr) either because 
an error code is returned by the call to kinect_read or because a shorter 
length is returned than the desired one.  In the error code case, I would 
guess that one would want to return the error code, but I don't know what 
on would want to return in the other case.  In any case, res is not 
defined by this code, so what is returned is whatever the result of the 
previous call to kinect_write happened to be.

How should the code be changed?

thanks,
julia
--
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


Re: [PATCH v3 13/19] media: dvb_core: slight optimization of addr compare

2013-12-25 Thread Sergei Shtylyov

Hello.

On 25-12-2013 7:29, Ding Tianhong wrote:


Use possibly more efficient ether_addr_equal
instead of memcmp.



Cc: Mauro Carvalho Chehab 
Cc: linux-media@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Yang Yingliang 
Signed-off-by: Ding Tianhong 
---
  drivers/media/dvb-core/dvb_net.c | 8 
  1 file changed, 4 insertions(+), 4 deletions(-)



diff --git a/drivers/media/dvb-core/dvb_net.c b/drivers/media/dvb-core/dvb_net.c
index f91c80c..3dfc33b 100644
--- a/drivers/media/dvb-core/dvb_net.c
+++ b/drivers/media/dvb-core/dvb_net.c
@@ -179,7 +179,7 @@ static __be16 dvb_net_eth_type_trans(struct sk_buff *skb,
eth = eth_hdr(skb);

if (*eth->h_dest & 1) {
-   if(memcmp(eth->h_dest,dev->broadcast, ETH_ALEN)==0)
+   if(ether_addr_equal(eth->h_dest,dev->broadcast))


   There should be space after comma.


@@ -674,11 +674,11 @@ static void dvb_net_ule( struct net_device *dev, const u8 
*buf, size_t buf_len )
if (priv->rx_mode != RX_MODE_PROMISC) {
if (priv->ule_skb->data[0] & 
0x01) {
/* multicast or 
broadcast */
-   if 
(memcmp(priv->ule_skb->data, bc_addr, ETH_ALEN)) {
+   if 
(!ether_addr_equal(priv->ule_skb->data, bc_addr)) {
/* multicast */
if 
(priv->rx_mode == RX_MODE_MULTI) {
int i;
-   for(i = 0; i < 
priv->multi_num && memcmp(priv->ule_skb->data, priv->multi_macs[i], ETH_ALEN); i++)
+   for(i = 0; i < 
priv->multi_num && !ether_addr_equal(priv->ule_skb->data, priv->multi_macs[i]); 
i++)


   Shouldn't this line be broken?



;
if (i == 
priv->multi_num)

drop = 1;


WBR, Sergei


--
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