From e24b169488b702f53d404f030d200f6a1dcf5c83 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sat, 14 Mar 2026 20:24:57 +0100 Subject: [PATCH] Identify wear level by attribute name and not by attribute id --- cmdline/support.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cmdline/support.c b/cmdline/support.c index a2f32dcc..ea8ccd58 100644 --- a/cmdline/support.c +++ b/cmdline/support.c @@ -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; } } }