projects
/
psensor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e19b7aa
)
cleanup
author
Jean-Philippe Orsini
<jeanfi@gmail.com>
Wed, 3 Sep 2014 07:47:58 +0000
(09:47 +0200)
committer
Jean-Philippe Orsini
<jeanfi@gmail.com>
Wed, 3 Sep 2014 07:47:58 +0000
(09:47 +0200)
src/lib/nvidia.c
patch
|
blob
|
history
diff --git
a/src/lib/nvidia.c
b/src/lib/nvidia.c
index
d50774c
..
2791df0
100644
(file)
--- a/
src/lib/nvidia.c
+++ b/
src/lib/nvidia.c
@@
-60,7
+60,7
@@
static char *get_product_name(int id)
return strdup("NVIDIA");
}
return strdup("NVIDIA");
}
-static double
nv_
get_temp(int id)
+static double get_temp(int id)
{
Bool res;
int temp;
{
Bool res;
int temp;
@@
-96,14
+96,6
@@
static double get_ambient_temp(int id)
return UNKNOWN_DBL_VALUE;
}
return UNKNOWN_DBL_VALUE;
}
-static double get_temp(int id, int type)
-{
- if (type & SENSOR_TYPE_AMBIENT)
- return get_ambient_temp(id);
- else
- return nv_get_temp(id);
-}
-
static double get_usage_att(char *atts, char *att)
{
char *c, *key, *strv, *s;
static double get_usage_att(char *atts, char *att)
{
char *c, *key, *strv, *s;
@@
-193,7
+185,10
@@
static void update(struct psensor *sensor)
double v;
if (sensor->type & SENSOR_TYPE_TEMP) {
double v;
if (sensor->type & SENSOR_TYPE_TEMP) {
- v = get_temp(sensor->nvidia_id, sensor->type);
+ if (sensor->type & SENSOR_TYPE_AMBIENT)
+ v = get_ambient_temp(sensor->nvidia_id);
+ else
+ v = get_temp(sensor->nvidia_id);
} else { /* SENSOR_TYPE_USAGE */
v = get_usage(sensor->nvidia_id, sensor->type);
}
} else { /* SENSOR_TYPE_USAGE */
v = get_usage(sensor->nvidia_id, sensor->type);
}