diff options
author | Jean Delvare <khali@linux-fr.org> | 2007-07-19 20:46:09 +0000 |
---|---|---|
committer | Jean Delvare <khali@linux-fr.org> | 2007-07-19 20:46:09 +0000 |
commit | 70317e1a0e0df66194a0162a16833675eccc9d4c (patch) | |
tree | beb318779655710f0ac6c58a158a139af2b5d250 /lib/access.h | |
parent | ac5ae18fe739638be6cd550a0ddb295da5ffcaad (diff) | |
download | lm-sensors-git-70317e1a0e0df66194a0162a16833675eccc9d4c.tar.gz |
The way we use sensors_feature_get_type() is rather suboptimal. It is
first called during the library initialization to generate the feature
tables. Then it is called again by sensors itself. This is because we
do not store the result the first time. I propose that we add a type
field to struct sensors_feature_data, where libsensors would store
the result of sensors_feature_get_type(). That way, the application
can get the information without calling sensors_feature_get_type()
again.
This change has the following benefits:
* Obviously, a small speed-up.
* sensors_feature_get_type() can be removed from the public interface.
This means that we can turn it into something that fits the
libsensors needs better, allowing for more optimizations (see next
patches.)
Note: the patch looks bigger that it really is, because I had to move
definitions around in sensors.h.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4629 7894878c-1315-0410-8ee3-d5d059ff63e0
Diffstat (limited to 'lib/access.h')
-rw-r--r-- | lib/access.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/access.h b/lib/access.h index 60068b7c..d416ad3a 100644 --- a/lib/access.h +++ b/lib/access.h @@ -29,4 +29,6 @@ extern const sensors_chip_feature *sensors_lookup_feature_nr(const sensors_chip_name *chip, int feature); +sensors_feature_type sensors_feature_get_type(const sensors_feature_data *feature); + #endif /* def LIB_SENSORS_ACCESS_H */ |