]> git.ipfire.org Git - telemetry.git/commitdiff
sensors: Add a helper "function" to determine the chip name
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 27 Mar 2026 14:46:48 +0000 (14:46 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 27 Mar 2026 14:46:48 +0000 (14:46 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/daemon/sensors.c
src/daemon/sensors.h

index ea16ecab78fd36c8dcd7f842be4e793b46e42a18..70db1b92ee1f6ae621290558419ea36ca50f4ea7 100644 (file)
@@ -101,7 +101,7 @@ int __td_sensors_name(char* name, size_t length,
        int r;
 
        // Make the chip name
-       r = sensors_snprintf_chip_name(chip_name, sizeof(chip_name), chip);
+       r = td_sensors_chip_name(chip_name, chip);
        if (r < 0)
                return r;
 
index fbfe8d20089442457eb3f20c7fd111a1c43e27ec..f98fa131524ec335e3fe45222dc86811147e5a6d 100644 (file)
@@ -31,6 +31,9 @@
 int td_sensors_init(td_ctx* ctx);
 int td_sensors_cleanup(td_ctx* ctx);
 
+#define td_sensors_chip_name(name, chip) \
+       sensors_snprintf_chip_name(name, sizeof(name), chip)
+
 #define td_sensors_name(name, chip, feature) \
        __td_sensors_name(name, sizeof(name), chip, feature)