scsa2usb needs some serious cleanup
driver - device drivers
There is a lot of the arcane in
scsa2usb. We should clean up:
- There is a relatively baroque debug logging infrastructure which is of course relatively useless unless you are running DEBUG bits. 90% of these messages are easily achieved (and with vast additional flexibility) using DTrace FBT probes. In the handful of cases where an FBT probe would not make it easy to see a particular value, we should add some SDT probes.
- There is a bunch of "test code" that complicates several critical routines in service of a test harness that it does not seem likely we will ever have. This should all just come out.
- There are also ample opportunities to clean up, including smatch, GCC warning, cstyle, and clarity issues.
- Finally, there are a number of very intricate quantities in the command object (
scsa2usb) that track transfer lengths, residues, offsets in buffers, etc. These could use some comments, and possibly SDT probes to make it clear when they are being changed.
I'd like to keep this work relatively separate from additional bug fixes or improvements like the pending #12929.