Hi Pekka,
Hi Denis,
2010/3/18 Denis Kenzior <denkenz(a)gmail.com>:
>> - if (!cbd || !passwd || strlen(passwd) > 4 || cls != 7)
>> + if (!cbd || !lock)
>> + goto error;
>> + if (!passwd || strlen(passwd) != 4 || strspn(passwd,
"0123456789")
>> != 4) goto error;
>
> I suggest not doing this checking in the driver code, if the core is
> sending you something you don't expect, let us fix the core.
Do you suggest removing all the current checks, and leaving only the
checks for possible features the driver does not support?
Correct. The reason is that I want to avoid the situation of each driver
doing its own checking. This quickly leads to a bunch of useless code and
most of it ends up incorrect or with only partial coverage.
If the core is sending things which are not valid, then the core has to be
fixed. This automatically fixes all the drivers too.
Regards,
-Denis