Klemens Nanni <k...@openbsd.org> wrote:

> > 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".

that simple flag will probably be too simple, and it won't be long
before someone in another architecture wants it to mean something more,
or wants another flag, and before long there will be zeal to flag carrying to
the sensor framework.

and what happens if two drivers set the flag?

Another way of doing this is for an platform to name the sensor driver which
has the info, and then search the sensor free.

Or, simply write per-platform code that finds it's own stuff.

Reply via email to