linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* question about drivers/media/dvb-frontends/rtl2830.c
@ 2012-08-26  7:25 Julia Lawall
  2012-08-26 11:20 ` Andy Walls
  0 siblings, 1 reply; 4+ messages in thread
From: Julia Lawall @ 2012-08-26  7:25 UTC (permalink / raw)
  To: mchehab, crope, linux-media

The function rtl2830_init contains the code:

         buf[0] = tmp << 6;
         buf[0] = (if_ctl >> 16) & 0x3f;
         buf[1] = (if_ctl >>  8) & 0xff;
         buf[2] = (if_ctl >>  0) & 0xff;

Is there any purpose to initializing buf[0] twice?

julia

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: question about drivers/media/dvb-frontends/rtl2830.c
  2012-08-26  7:25 question about drivers/media/dvb-frontends/rtl2830.c Julia Lawall
@ 2012-08-26 11:20 ` Andy Walls
  2012-08-26 16:06   ` Antti Palosaari
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Walls @ 2012-08-26 11:20 UTC (permalink / raw)
  To: Julia Lawall, mchehab, crope, linux-media

Julia Lawall <julia.lawall@lip6.fr> wrote:

>The function rtl2830_init contains the code:
>
>         buf[0] = tmp << 6;
>         buf[0] = (if_ctl >> 16) & 0x3f;
>         buf[1] = (if_ctl >>  8) & 0xff;
>         buf[2] = (if_ctl >>  0) & 0xff;
>
>Is there any purpose to initializing buf[0] twice?
>
>julia
>--
>To unsubscribe from this list: send the line "unsubscribe linux-media"
>in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

Hmm.  Since 0x3f is the lowest 6 bits, it looks like the second line should use |= instead of = .   I don't know anything about the rt2830 though.

-Andy

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: question about drivers/media/dvb-frontends/rtl2830.c
  2012-08-26 11:20 ` Andy Walls
@ 2012-08-26 16:06   ` Antti Palosaari
  2012-08-26 16:16     ` Julia Lawall
  0 siblings, 1 reply; 4+ messages in thread
From: Antti Palosaari @ 2012-08-26 16:06 UTC (permalink / raw)
  To: Andy Walls, Julia Lawall; +Cc: mchehab, linux-media

On 08/26/2012 02:20 PM, Andy Walls wrote:
> Julia Lawall <julia.lawall@lip6.fr> wrote:
>
>> The function rtl2830_init contains the code:
>>
>>          buf[0] = tmp << 6;
>>          buf[0] = (if_ctl >> 16) & 0x3f;
>>          buf[1] = (if_ctl >>  8) & 0xff;
>>          buf[2] = (if_ctl >>  0) & 0xff;
>>
>> Is there any purpose to initializing buf[0] twice?
>>
>> julia
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-media"
>> in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
> Hmm.  Since 0x3f is the lowest 6 bits, it looks like the second line should use |= instead of = .   I don't know anything about the rt2830 though.
>
> -Andy

Andy is correct. If you look few lines just before that you could see 
that logic. Patch is welcome.

regards
Antti


-- 
http://palosaari.fi/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: question about drivers/media/dvb-frontends/rtl2830.c
  2012-08-26 16:06   ` Antti Palosaari
@ 2012-08-26 16:16     ` Julia Lawall
  0 siblings, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2012-08-26 16:16 UTC (permalink / raw)
  To: Antti Palosaari; +Cc: Andy Walls, Julia Lawall, mchehab, linux-media

On Sun, 26 Aug 2012, Antti Palosaari wrote:

> On 08/26/2012 02:20 PM, Andy Walls wrote:
>> Julia Lawall <julia.lawall@lip6.fr> wrote:
>> 
>>> The function rtl2830_init contains the code:
>>>
>>>          buf[0] = tmp << 6;
>>>          buf[0] = (if_ctl >> 16) & 0x3f;
>>>          buf[1] = (if_ctl >>  8) & 0xff;
>>>          buf[2] = (if_ctl >>  0) & 0xff;
>>> 
>>> Is there any purpose to initializing buf[0] twice?
>>> 
>>> julia
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-media"
>>> in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> 
>> Hmm.  Since 0x3f is the lowest 6 bits, it looks like the second line should 
>> use |= instead of = .   I don't know anything about the rt2830 though.
>> 
>> -Andy
>
> Andy is correct. If you look few lines just before that you could see that 
> logic. Patch is welcome.

Done.  Thanks for the quick responses.

julia

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-08-26 16:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-26  7:25 question about drivers/media/dvb-frontends/rtl2830.c Julia Lawall
2012-08-26 11:20 ` Andy Walls
2012-08-26 16:06   ` Antti Palosaari
2012-08-26 16:16     ` Julia Lawall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).