From 6fd7ad9fb2021ea71a5f2d0ede1f92fa7b86ff83 Mon Sep 17 00:00:00 2001 From: Jim Ma Date: Sun, 14 May 2023 18:09:45 +0800 Subject: [PATCH] reset sensor_num before update in all bios shim --- shim/bios/bios_hwmon_shim.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shim/bios/bios_hwmon_shim.c b/shim/bios/bios_hwmon_shim.c index 90de76b..6d8cf76 100644 --- a/shim/bios/bios_hwmon_shim.c +++ b/shim/bios/bios_hwmon_shim.c @@ -173,6 +173,7 @@ static int bios_hwmon_get_thermal(SYNO_HWMON_SENSOR_TYPE *reading) guarded_strscpy(reading->type_name, HWMON_SYS_THERMAL_NAME, sizeof(reading->type_name)); hwmon_pr_loc_dbg("mfgBIOS: => %s(type=%s)", __FUNCTION__, reading->type_name); + reading->sensor_num = 0; for (int i = 0; i < HWMON_SYS_THERMAL_ZONE_IDS; i++) { if (hwmon_cfg->sys_thermal[i] == HWMON_SYS_TZONE_NULL_ID) break; @@ -207,6 +208,7 @@ static int bios_hwmon_get_voltages(SYNO_HWMON_SENSOR_TYPE *reading) guarded_strscpy(reading->type_name, HWMON_SYS_VOLTAGE_NAME, sizeof(reading->type_name)); hwmon_pr_loc_dbg("mfgBIOS: => %s(type=%s)", __FUNCTION__, reading->type_name); + reading->sensor_num = 0; for (int i = 0; i < HWMON_SYS_VOLTAGE_SENSOR_IDS; i++) { if (hwmon_cfg->sys_voltage[i] == HWMON_SYS_VSENS_NULL_ID) break;