Am 22.11.2011 23:09 schrieb Stefan Tauner:
(the buffer handling in) ft2232_spi.c is slightly awful :) various "bufs" (well, 2), some of them static (ok, only the one in send_command, but still this is messier than expected for such a simple driver), the two ~equivalent failed/ret variables in send_command etc. make it a bit unreadable.
Indeed, this file could use some cleanup.
we need to check for failure of the buffer methods anyway, so i dont see a reason to do the size checks in the caller(s).
i have reverted the whole file now, because i am not sure how to proceed and wanted to publish what i have. not much changed, but i had to rebase it due to the addition of the opaque framework and hwseq.
[…] With the above comments this is Acked-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
should i commit the attached version?
Please do, the ack is still valid.
I wonder whether we should enable the sign warnings once the cleanups and remaining conversions are in. The big problem might be platform (OS/library version) dependent changes which we don't know of, but OTOH we won't know until we try it.
Regards, Carl-Daniel