[haiku-commits] Re: r42058 - haiku/trunk/src/add-ons/kernel/drivers/disk/usb/usb_disk

  • From: Siarzhuk Zharski <zharik@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 08 Jun 2011 22:04:49 +0200

Am 08.06.2011 20:45, schrieb kallisti5@xxxxxxxxxxx:

-               for (uint32 tries = 0; tries<  3; tries++) {
+               for (uint8 tries = 0; tries<  8; tries++) {

useless change. ;-) The compiler is smart enough to use the whole register for counter anyway. But do not forget that from the "CPU's point of view" operating on types not equal to register size usually requires more CPU power. So trying to economize some bits you will lost performance in extra CPU operations. :-P

If I understand right, you are trying to add support of CD/DVD drives to usb_disk? As far as I remember from my usb_scsi work the SCSI command sets for HDD and for CD-ROMs are different. From other side the system works with CDs differenttly from HDDs. Doesn't messing all into single driver overcomplicating it?


-                       snooze(10000);
+                       uint32_t snoozeTime = 1000000 * tries;
+                       TRACE("snoozing %u microseconds for usb lun\n", 
snoozeTime);
+                       snooze(snoozeTime);

Why you not using the developer branch for such playings?

---
Kind Regards,
  S.Zharski


Other related posts: