diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-04-24 00:52:02 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-04-24 00:52:02 +0200 |
commit | e9e9be9def29ecf57c5d6c1187c7e7e00f165e47 (patch) | |
tree | ff71aac9179614ce401b6005b7c4ceb58e5faee5 /atasmart.c | |
parent | a80d7d5c25e88adea7b8e843cdb57143e6cfb46b (diff) |
Get rid of qurik 9_UNKNOWN again
Apparently Seagate seems to use the MSB's of the raw data of the
power-on-time field for something else on some disks, so let's just look
at the lower 32bits of that field and we get a value that works on all
disks including those from Seagate. 32bit should be more than enough to
encode the power-on-time for almost all disks so this should not be much
of a limitation.
Diffstat (limited to 'atasmart.c')
-rw-r--r-- | atasmart.c | 15 |
1 files changed, 3 insertions, 12 deletions
@@ -1128,7 +1128,7 @@ static void make_pretty(SkSmartAttributeParsedData *a) { else if (!strcmp(a->name, "power-on-hours") || !strcmp(a->name, "loaded-hours") || !strcmp(a->name, "head-flying-hours")) - a->pretty_value = fourtyeight * 60 * 60 * 1000; + a->pretty_value = (fourtyeight & 0xFFFFFFFFU) * 60 * 60 * 1000; else if (!strcmp(a->name, "reallocated-sector-count")) a->pretty_value = fourtyeight & 0xFFFFFFFFU; else @@ -1204,8 +1204,7 @@ typedef enum SkSmartQuirk { SK_SMART_QUIRK_194_10XCELSIUS = 32, SK_SMART_QUIRK_194_UNKNOWN = 64, SK_SMART_QUIRK_200_WRITEERRORCOUNT = 128, - SK_SMART_QUIRK_201_DETECTEDTACOUNT = 256, - SK_SMART_QUIRK_9_UNKNOWN = 512 + SK_SMART_QUIRK_201_DETECTEDTACOUNT = 256 } SkSmartQuirk; /* %STRINGPOOLSTART% */ @@ -1219,7 +1218,6 @@ static const char *quirk_name[] = { "194_UNKNOWN", "200_WRITEERRORCOUNT", "201_DETECTEDTACOUNT", - "9_UNKNOWN", NULL }; /* %STRINGPOOLSTOP% */ @@ -1232,12 +1230,6 @@ typedef struct SkSmartQuirkDatabase { static const SkSmartQuirkDatabase quirk_database[] = { { - /*** Seagate */ - "^ST9160821AS$", - NULL, - SK_SMART_QUIRK_9_UNKNOWN - }, { - /*** Fujitsu */ "^FUJITSU MHR2040AT$", NULL, @@ -1459,8 +1451,7 @@ static const SkSmartAttributeInfo *lookup_attribute(SkDisk *d, uint8_t id) { "power-on-half-minutes", SK_SMART_ATTRIBUTE_UNIT_MSECONDS }; return &a; - } else if (quirk & SK_SMART_QUIRK_9_UNKNOWN) - return NULL; + } /* %STRINGPOOLSTOP% */ break; |