All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: [PATCH 2/2] [media] media-device: use unsigned ints on some places
Date: Wed, 09 Sep 2015 13:36:50 +0200	[thread overview]
Message-ID: <55F019D2.7040907@xs4all.nl> (raw)
In-Reply-To: <b1205852042ddb1aff6a53077e7e28d75fcb02c0.1441798267.git.mchehab@osg.samsung.com>

On 09/09/15 13:32, Mauro Carvalho Chehab wrote:
> 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>
> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

> 
> diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
> index 13987710e5bc..1312e93ebd6e 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;
> +	int ret = 0;
> +	unsigned int i;
>  
>  	topo->topology_version = mdev->topology_version;
>  
> @@ -613,7 +614,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)
> @@ -650,9 +651,9 @@ 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;
> +	unsigned int i;
>  
>  	if (mdev == NULL)
>  		return;
> 

  reply	other threads:[~2015-09-09 11:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-09 11:32 [PATCH 0/2] MC minor cleanups Mauro Carvalho Chehab
2015-09-09 11:32 ` [PATCH 1/2] [media] media_entity: remove gfp_flags argument Mauro Carvalho Chehab
2015-09-09 11:36   ` Hans Verkuil
2015-11-23 16:41   ` Laurent Pinchart
2015-09-09 11:32 ` [PATCH 2/2] [media] media-device: use unsigned ints on some places Mauro Carvalho Chehab
2015-09-09 11:36   ` Hans Verkuil [this message]
2015-11-23 16:25   ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55F019D2.7040907@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@osg.samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.