Re: Re: [video4linux-cvs] [hg:v4l-dvb] Add support for Opera S1- DVB-USB

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/20/07, Michael Krufky <mkrufky@xxxxxxxxxxx> wrote:
Mauro Carvalho Chehab wrote:
> Em Sex, 2007-04-20 às 13:53 +0200, Johannes Stezenbach escreveu:
>> On Fri, Apr 20, 2007, Mauro Carvalho Chehab wrote:
>>> Argh! Too much flood for two simple defines!
>> I _think_ the point Mike was driving at is that there
>> is an established coding pattern of having a
>>
>> struct foo_config {
>> 	u8 i2c_addr;
>> 	...
>> };
>>
>> If you use that then the #define is (at least) superflous,
>> "foo_tuner.i2c_addr = 0x62;" does the job.
>>
>> If you don't use it, then the #define increases readability.
>> However, experience shows that soon enough there'll be
>> another similar device with a different i2c_addr so it makes
>> sense to use the pattern right from the start.

Thank you, Johannes -- This is exactly the point that I was trying to make.

>
> Ok, this makes sense.
>
> The point that I'm trying to argue is that this specific driver is full
> of magic values. I suspect that the author doesn't have datasheets for
> the chipsets inside the board. Almost all the driver are doing some
> magic, making hard to understand precisely what are being programmed at
> the device.
>
> The proper solution would be if somebody with a datasheet could send a
> patch replacing those magic by register aliases, making easier to get a
> picture. While we don't have such patch, IMO, it is better to try to
> generate some hints for each possible magic at the driver. Hopefully,
> some day we will have enough knowledge to understand all.

I don't disagree with you, Mauro.  #defines will indeed help to make the
code
more readable, and I am all for that sort of thing... But it is just
unnecessary
for the i2c addresses, as explained above by Johannes.


think it went into the wrong light, I see it now too you're right with
it this isn't really needed neither does it improve anything..

Markus

_______________________________________________
linux-dvb mailing list
linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb


[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux