Mailing List archive

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

[linux-dvb] Re: Two DVB-cards, change order?



Marcus Johansson wrote:
> 
> However, I'm using a quite old DVB driver (2003-11-08), so the patch is 
> probably not very useful. I guess I should check out the latest driver 
> from CVS and make it work there instead, and then send you the patch... 
> Do I have to make a patch for both 2.4 and 2.6, or is 2.4 considered 
> "obsolete" for DVB development?

dvbdev_get_free_adapter_num() hasn't changed for ages, so your patch
probably applies to both 2.4 and 2.6.

> And DVB_MAX_IDS is the number of DVB-cards the driver supports right? (I 
> want to use it for setting the size of the module parameter array, but 
> wasn't sure)

Yes. Some people want support for more than four cards, but currently
DVB_MAX_IDS is a hard limit. Please use the constant, it makes it
easier ot find code that needs changing if we were to support more
cards.

Your patch has a few problems, though. First of all,
*always* create patches with "diff -up".


> + static int adapter_numbering[4] = { -1 };
> + int adapter_numbering_current=0;

make that static, too

> + 	if (adapter_numbering[0] != -1) {
> + 		num = adapter_numbering[adapter_numbering_current];
> + 		adapter_numbering_current++;
> + 		return num;
> + 	}

Please add a check that numbers are in range 0..3.
Also, I'm not sure what happens if someone accidentally specifies
a number twice, e.g. adapter_numbering=0,0. If it Oopses we
must add check to prevent the Ooops.

> + MODULE_PARM(adapter_numbering,"1-4i");
> + MODULE_PARM_DESC(adapter_numbering, "change numbering of adapters");

That description could be a little bit more user friendly.

Thanks,
Johannes




Home | Main Index | Thread Index