Source-Changes archive

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

Re: CVS commit: src/sys/dev/ic



In article <060904041043.M0209371%mirage.ceres.dti.ne.jp@localhost>,
Izumi Tsutsui  <tsutsui%ceres.dti.ne.jp@localhost> wrote:
>christos%zoulas.com@localhost wrote:
>
>> | > Modified Files:
>> | >  src/sys/dev/ic: mb89352.c
>> | > 
>> | > Log Message:
>> | > comment out impossible code
>> | 
>> | Isn't it better to make sc_dleft signed?
>> | (maybe this code should be wrapped by #ifdef DIAGNOSTIC anyway)
>> 
>> I think that keeping things unsigned makes the code simpler. Having
>> the checks always in the kernel prevents buffer overflows and crashes.
>
>But you #if 0'ed out a check ("data xfered more than requested bytes")
>which didn't work as intended because sc_dleft was unsigned.

I suspect that sc_dleft was initially signed, and then someone changed
it to unsigned without removing the test. I left the code commented out
just to make it clear that the test is not needed.

christos




Home | Main Index | Thread Index | Old Index