summaryrefslogtreecommitdiff
path: root/drivers/media/media-device.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-09-09 08:23:51 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-01-11 12:19:02 -0200
commit9033b1a47038fdba388fc13613de23508dccb075 (patch)
tree8e921e4d3ead2f10b9c5a9ccac505e0cb58be7e3 /drivers/media/media-device.c
parent0b3b72df9018c0386293c2f529b91ed17448288a (diff)
[media] media-device: use unsigned ints on some places
The entity->num_pads are defined as u16. So, better to use an unsigned int, as this prevents additional warnings when W=2 (or W=1 on some architectures). The "i" counter at __media_device_get_topology() is also a monotonic counter that should never be below zero. So, make it unsigned too. Suggested-by: Sakari Ailus <sakari.ailus@iki.fi> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/media-device.c')
-rw-r--r--drivers/media/media-device.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
index f177d50c7a44..3d0a77c1c899 100644
--- a/drivers/media/media-device.c
+++ b/drivers/media/media-device.c
@@ -243,7 +243,8 @@ static long __media_device_get_topology(struct media_device *mdev,
struct media_v2_interface uintf;
struct media_v2_pad upad;
struct media_v2_link ulink;
- int ret = 0, i;
+ unsigned int i;
+ int ret = 0;
topo->topology_version = mdev->topology_version;
@@ -609,7 +610,7 @@ EXPORT_SYMBOL_GPL(media_device_unregister);
int __must_check media_device_register_entity(struct media_device *mdev,
struct media_entity *entity)
{
- int i;
+ unsigned int i;
if (entity->function == MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN ||
entity->function == MEDIA_ENT_F_UNKNOWN)
@@ -646,10 +647,10 @@ EXPORT_SYMBOL_GPL(media_device_register_entity);
*/
void media_device_unregister_entity(struct media_entity *entity)
{
- int i;
struct media_device *mdev = entity->graph_obj.mdev;
struct media_link *link, *tmp;
struct media_interface *intf;
+ unsigned int i;
if (mdev == NULL)
return;