Identify wear level by attribute name and not by attribute id
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-win (push) Waiting to run
CodeQL Advanced / Analyze (c-cpp) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run

This commit is contained in:
Andrea Mazzoleni 2026-03-14 20:24:57 +01:00
parent c449864fc7
commit e24b169488

View file

@ -2231,12 +2231,10 @@ int smartctl_attribute(FILE* f, const char* file, const char* name, struct smart
* 233: Media_Wearout_Indicator (Intel)
*/
if (norm <= 100) {
switch (id) {
case 177 :
case 233 :
case 231 :
if (strcmp(id_name, "Wear_Leveling_Count") == 0
|| strcmp(id_name, "SSD_Life_Left") == 0
|| strcmp(id_name, "Media_Wearout_Indicator") == 0) {
smart[SMART_WEAR_LEVEL].raw = 100 - norm;
break;
}
}
}