On Thu, 2022-04-28 at 11:34 -0700, Linus Torvalds wrote:
> On Thu, Apr 28, 2022 at 10:30 AM Linus Torvalds
> <torva...@linux-foundation.org> wrote:
> > In fact, we should probably fill in all the other 'index[]' entries
> > too, but we never did, because [..]
> 
> Actually, the reason we never did is that we never expanded our sample
> array past two sensors.
> 
> I thought we had, but we still have MAX_SENSORS being 2 (and a few sad
> hard-coded twos in the code, for that matter).
> 
> So even if the code is (mostly) set up to handle more sensors, and
> even though I at one point wanted to get rid of the sensor thing
> entirely (and just make sensor numbers match cylinders), that never
> actually happened.
> 
> And nobody seems to have noticed or cared, so I guess it's just as well.

Having looked at this a bit more I think there is one key reason why
noone noticed or cared. There appears to be exactly one backend that
can give you multiple pressure readings per sample (Shearwater), and
from what I understand, even if you have three tank sensors and use
three tanks on your dive (which now really puts you in the sub-one-
permille range of our user base, or "maybe a dozen or two"), in most
cases our code STILL does the right (-ish) thing.

We have all this insane complexity for a miniscule minority of our
users.

And, why has no one noticed the breakage that I pointed out?

Oh, because we appear to have only one dive computer that we support
who will give you that ordered list of tanks that creates the scenario
that makes the bug visible to a user (that would be the Cobalt2)

/D

_______________________________________________
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to