On 30 September 2010 01:12, Roman Yeryomin <[email protected]> wrote:
>> +       if (val->port_vlan < 5) {
>
> RTL8366RB_PORT_NUM_CPU?

Sure

> if to follow your logic you should append `|| val->value.i < 0` also

Actually, this way one can use both 0 or any negative value to set
unlimited bandwidth.
I would find natural to limit bandwidth to -1 not to limit it at all.

>> +       val->value.i = (val->value.i - 1) / RTL8366RB_BDTH_UNIT;
>> +       if (val->value.i < 0)
>>                val->value.i = RTL8366RB_BDTH_REG_DEFAULT;
>
> so you assume that 0 is valid value?
> I would think that 0 means unlimited

Yeah, I didn't think that (0-1)/64=0 in integers.

> This is probably more a matter of taste but why not to use if/else
> instead of double assignment?

Probably more clear your way, I wouldn't have been fooled by the rounding thing.
I'll correct these while implementing priority selection.
Cheers,

Luca
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to