Hi Arjen, yes, you are right. The calls to dstate_dataok() in usbhid_ups.c:hid_ups_walk() are somewhat random. I am worried about this:
if ( (retcode == -EPERM) || (retcode == -EPIPE) || (retcode == -ENODEV) || (retcode == -EACCES) || (retcode == -EIO) || (retcode == -ENOENT) ) break; else { /* atomic call */ dstate_dataok(); } In my opinion, it should be if (retcode < 0) { /* any device error */ break; } else { /* retcode == 0 */ /* do nothing */ } But that function is spaghetti code anyway. It is a perfect example of how not to use structured programming - I think a function with 30 goto's would be easier to read than this particular pile of nested if-then-else's, nested loops, 'break' statements, variable assignments hidden inside "if" conditions, and other assorted mischief. It is on my list of things to rewrite soon. -- Peter Arjen de Korte wrote: > > [...] > > > I hope this small part of the log helps. > > Maybe someone with more experience with the 'usbhid-ups' driver is able t= > o > decipher what is going on. I'm still waiting for someone to send me a > USB-HID UPS so that I can debug things like this myself. > > Best regards, Arjen > > > _______________________________________________ > Nut-upsuser mailing list > Nut-upsuser@lists.alioth.debian.org > http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser > _______________________________________________ Nut-upsuser mailing list Nut-upsuser@lists.alioth.debian.org http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser