Em Mon, 12 Oct 2015 22:35:21 +0300 Sakari Ailus sakari.ailus@iki.fi escreveu:
Hi Mauro,
On Mon, Oct 12, 2015 at 01:42:55PM -0300, Mauro Carvalho Chehab wrote:
diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c index 81d6a130efef..3bdda16584fe 100644 --- a/drivers/media/media-device.c +++ b/drivers/media/media-device.c @@ -427,6 +427,8 @@ EXPORT_SYMBOL_GPL(media_device_unregister); int __must_check media_device_register_entity(struct media_device *mdev, struct media_entity *entity) {
- int i;
i should be unsigned, not signed.
I'm pretty sure you pointed that already and I fixed on a latter patch. It is at patch 80/83.
As I justified on that thread, rebasing a 83 patch series to touch at the 6th patch is risky, as it could cause breakages and badly solved conflicts. So, I really prefer not doing that, specially when it is a minor issue.
Regards, Mauro
- /* Warn if we apparently re-register an entity */ WARN_ON(entity->parent != NULL); entity->parent = mdev;
@@ -435,6 +437,12 @@ int __must_check media_device_register_entity(struct media_device *mdev, /* Initialize media_gobj embedded at the entity */ media_gobj_init(mdev, MEDIA_GRAPH_ENTITY, &entity->graph_obj); list_add_tail(&entity->list, &mdev->entities);
/* Initialize objects at the pads */
for (i = 0; i < entity->num_pads; i++)
media_gobj_init(mdev, MEDIA_GRAPH_PAD,
&entity->pads[i].graph_obj);
spin_unlock(&mdev->lock);
return 0;
@@ -450,12 +458,15 @@ EXPORT_SYMBOL_GPL(media_device_register_entity); */ void media_device_unregister_entity(struct media_entity *entity) {
- int i;
Same here. Also it's a good practice to arrange loop and temporary variables as last.
struct media_device *mdev = entity->parent;
if (mdev == NULL) return;
spin_lock(&mdev->lock);
- for (i = 0; i < entity->num_pads; i++)
media_gobj_remove(&entity->graph_obj); list_del(&entity->list); spin_unlock(&mdev->lock);media_gobj_remove(&entity->pads[i].graph_obj);