}
/* Entry point for AMD sensors */
-struct psensor * *
-amd_psensor_list_add(struct psensor **sensors, int values_len)
+void amd_psensor_list_append(struct psensor ***sensors, int values_len)
{
int i, j, n;
- struct psensor **tmp, **ss, *s;
+ struct psensor *s;
n = init();
- ss = sensors;
for (i = 0; i < n; i++)
/* Each GPU Adapter has 3 sensors: temp, fan speed and usage */
for (j = 0; j < 3; j++) {
s = create_sensor(i, j, values_len);
- tmp = psensor_list_add(ss, s);
-
- if (ss != tmp)
- free(ss);
-
- ss = tmp;
+ psensor_list_append(sensors, s);
}
-
- return ss;
}
void amd_cleanup()
#include "psensor.h"
-/*
- Updates temperatures of AMD sensors.
-*/
void amd_psensor_list_update(struct psensor **sensors);
-/*
- Adds AMD sensors to a given list of sensors.
-
- Returns the new allocated list of sensors if sensors have been added
- otherwise returns 'sensors'. The list is 'NULL' terminated.
- */
-struct psensor **amd_psensor_list_add(struct psensor **sensors,
- int values_max_length);
+void amd_psensor_list_append(struct psensor ***sensors, int values_max_length);
void amd_cleanup();
#endif
#ifdef HAVE_LIBATIADL
if (config_is_atiadlsdk_enabled())
- sensors = amd_psensor_list_add(sensors, 600);
+ amd_psensor_list_append(&sensors, 600);
#endif
#ifdef HAVE_GTOP
if (config_is_gtop2_enabled())