public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Mike Isely <isely@isely.net>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCHv2 5/8] [media] pvrusb2: initialize standards mask before detecting standard
Date: Wed, 05 Oct 2011 14:49:40 -0300	[thread overview]
Message-ID: <4E8C98B4.7090209@redhat.com> (raw)
In-Reply-To: <alpine.DEB.1.10.1110050857090.9044@cnc.isely.net>

Em 05-10-2011 11:00, Mike Isely escreveu:
>
> Mauro:
>
> With the line you've just added, then the " = arg" assignment in the
> immediate prior line is effectively dead code.  Try this instead:

Look better:

>>   		v4l2_std_id *std = arg;
>> +		*std = V4L2_STD_ALL;

The above code is creating a pointer 'std' of the type 'v4l2_std_id', and
initializing the pointer with the void *arg.

Then, it is doing an indirect reference to the pointer, filling its
contents with V4L2_STD_ALL value.

The code above is sane (and, btw, it works). After those patches, the
detection code will detect PAL/M or NTSC/M depending on the channel I
tune here (my cable operator broadcasts some channels with one format,
and others with the other one). Before this patch and the msp3400, it
would return a mask with PAL/M and PAL/60 or a mask with all NTSC/M formats.

Regards,
Mauro.

>
>   	case VIDIOC_QUERYSTD:
>   	{
> -		v4l2_std_id *std = arg;
> +		v4l2_std_id *std = V4L2_STD_ALL;
>   		ret = pvr2_hdw_get_detected_std(hdw, std);
>   		break;
>   	}
>
>    -Mike
>
>
> On Tue, 4 Oct 2011, Mauro Carvalho Chehab wrote:
>
>> Signed-off-by: Mauro Carvalho Chehab<mchehab@redhat.com>
>> ---
>>   drivers/media/video/pvrusb2/pvrusb2-v4l2.c |    1 +
>>   1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
>> index 0d029da..ce7ac45 100644
>> --- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
>> +++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
>> @@ -230,6 +230,7 @@ static long pvr2_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
>>   	case VIDIOC_QUERYSTD:
>>   	{
>>   		v4l2_std_id *std = arg;
>> +		*std = V4L2_STD_ALL;
>>   		ret = pvr2_hdw_get_detected_std(hdw, std);
>>   		break;
>>   	}
>>
>


  reply	other threads:[~2011-10-05 17:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-04 19:53 [PATCHv2 1/8] [media] saa7115: Fix standards detection Mauro Carvalho Chehab
2011-10-04 19:53 ` [PATCHv2 2/8] [media] pvrusb2: implement VIDIOC_QUERYSTD Mauro Carvalho Chehab
2011-10-04 19:53   ` [PATCHv2 3/8] [media] v4l2-ioctl: Fill the default value for VIDIOC_QUERYSTD Mauro Carvalho Chehab
2011-10-04 19:53     ` [PATCHv2 4/8] [media] saa7115: Trust that V4L2 core will fill the mask Mauro Carvalho Chehab
2011-10-04 19:53       ` [PATCHv2 5/8] [media] pvrusb2: initialize standards mask before detecting standard Mauro Carvalho Chehab
2011-10-04 19:53         ` [PATCHv2 6/8] [media] videodev2: Reorganize standard macros and add a few more Mauro Carvalho Chehab
2011-10-04 19:53           ` [PATCHv2 7/8] [media] msp3400: Add standards detection to the driver Mauro Carvalho Chehab
2011-10-04 19:53             ` [PATCHv2 8/8] [media] em28xx: Add VIDIOC_QUERYSTD support Mauro Carvalho Chehab
2011-10-05 14:00         ` [PATCHv2 5/8] [media] pvrusb2: initialize standards mask before detecting standard Mike Isely
2011-10-05 17:49           ` Mauro Carvalho Chehab [this message]
2011-10-05 21:55             ` Mike Isely

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=4E8C98B4.7090209@redhat.com \
    --to=mchehab@redhat.com \
    --cc=isely@isely.net \
    --cc=linux-media@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox