On Sun, Mar 21, 2021 at 11:56:42AM -0600, Theo de Raadt wrote:
> The sensor framework generally does not know where a sensor is.  A
> sensor could reside on some device which has been plugged in, rather
> than be the primary sensor.
> 
> But the users of apm are only hoping for best effort.
> 
> meaning "some information", not "perfect information".  Many PC BIOS
> have lied in these fields before also, yet all the apm command users
> survived.
That's what my diff does really: best effort for some information.

> So which is better:
> 
> (1) try to emit some information for the people who quicky-use the apm 
> interface
> 
> (2) change apm to not print those lines on architectures where we are unsure.
> 
> I think (1) is acceptable for a tool which has never promised perfect 
> accuracy. 
I concur (obviously).

> I suspect hard-wiring this to one driver is going to be better than scanning
> the sensor list and heuristically determining which specific sensors to look 
> at,
> because the only good selector now is strcmp(sensor->desc, "battery remaining 
> minutes")
> yuck.
To be fair, kettenis proposed a rough idea to have simpler/faster checks
than strcmp().  With a simple flag you wouldn't need any heuristics
either but let the sensor framework -which has all the pieces- do the
work and put a stamp on the ready-to-use value saying "use this as
battery level".

Reply via email to