Hi!
After getting a couple reports that the Artop driver doesn't work, I
decided to take a look at it ... well and I decided that this is
impossible to debug, so I rewrote it from scratch instead. I have no
documentation nor the actual hardware, so it may be wrong somewhere,
but I think definitely less wrong than the original one.
I must say I also thought about preserving the original one for it's
humoristic value, consider what the following statements do:
1) #define SPLIT_BYTE(B,H,L) ((H)=(B>>4), (L)=(B-((B>>4)<<4)))
... computation of L is just wonderful - first shift B down, then up
again, this clears the lower four bits, and then subtract that from B.
What a nice way to write ((B) & 0xf) ...
2) ((art&0x06)==0x06)?"5":((art&0x05)==0x05)?"4":((art&0x04)==0x04)?"3":((art&0x03)==0x03)?"2":((art&0x02)==0x02)?"1":((art&0x01)==0x01)?"0":"?"
... this is a real pearl - what a cool way to compute (art - 1).
2a)
switch(speed) {
case 7: return "6";
case 6: return "5";
case 5: return "4";
case 4: return "3";
case 3: return "2";
case 2: return "1";
case 1: return "0";
case 0: return "?";
}
... another one, for the same purpose with a different chip version.
3) ((0x00 << (2*drive->dn))
... no comment
-- Vojtech Pavlik SuSE Labs
This archive was generated by hypermail 2b29 : Fri May 31 2002 - 22:00:12 EST