[pvrusb2] [PATCH?] division to bit-or of tveeprom standards

Mike Isely isely at isely.net
Thu Nov 29 12:25:45 CST 2007


On Thu, 29 Nov 2007, Roel Kluin wrote:

> Considering struct pvr2_std_hack - a data structure that labels specific
> combinations of standards from tveeprom - line 1715 in 
> drivers/media/video/pvrusb2/pvrusb2-hdw.c:
> 
> const static struct pvr2_std_hack std_eeprom_maps[] = {
> ...
>         {       /* PAL(D/D1/K) */
>                 .pat = V4L2_STD_DK,
> 		.std = V4L2_STD_PAL_D/V4L2_STD_PAL_D1|V4L2_STD_PAL_K,
>         },
> };
> 
> Note that due to operator precedence this is equivalent to:
> 		.std = (V4L2_STD_PAL_D / V4L2_STD_PAL_D1) | V4L2_STD_PAL_K,

That is clearly a bug!

> 
> is this intended? It appears to me due to the comments that intended is:
> 		.std = V4L2_STD_PAL_D | V4L2_STD_PAL_D1 | V4L2_STD_PAL_K,
> 
> Please comment: I am no expert in this. If correctly assumed consider the
> patch below.

Comment:  You are absolutely correct.  Thanks for spotting this and I'll 
post an update as soon as I can (which will be a few days yet, 
unfortunately).

  -Mike



-- 
                        |         Mike Isely          |     PGP fingerprint
     Spammers Die!!     |                             | 03 54 43 4D 75 E5 CC 92
                        |   isely @ pobox (dot) com   | 71 16 01 E2 B5 F5 C1 E8
                        |                             |


More information about the pvrusb2 mailing list