Ticket #749: 0001-PATCH-ataprint.cpp-Print-missing-tje-Valid-Value-bit.patch

File 0001-PATCH-ataprint.cpp-Print-missing-tje-Valid-Value-bit.patch, 1.6 KB (added by JonghwanChoi, 3 years ago)
  • ataprint.cpp

    From 5bfa0f7563058dd743ca934f2bdc287a5c794d01 Mon Sep 17 00:00:00 2001
    From: Jonghwan Choi <jhbird.choi@gmail.com>
    Date: Tue, 11 Oct 2016 14:37:06 +0900
    Subject: [PATCH] ataprint.cpp Print missing the Valid Value bit in
     ACS-3 Device Statistics Flags
    
    Signed-off-by: Jonghwan Choi <jhbird.choi@gmail.com>
    ---
     ataprint.cpp | 10 ++++++----
     1 file changed, 6 insertions(+), 4 deletions(-)
    
    diff --git a/ataprint.cpp b/ataprint.cpp
    index 593e2cb..74cb09c 100644
    a b static void print_device_statistics_page(const unsigned char * data, int page) 
    15391539      valstr[0] = '-'; valstr[1] = 0;
    15401540    }
    15411541
    1542     pout("0x%02x  0x%03x  %d %15s  %c%c%c%c %s\n",
     1542    pout("0x%02x  0x%03x  %d %15s  %c%c%c%c%c %s\n",
    15431543      page, offset,
    15441544      abs(size),
    15451545      valstr,
     1546      ((flags & 0x40) ? 'V' : '-'), // valid value
    15461547      ((flags & 0x20) ? 'N' : '-'), // normalized statistics
    15471548      ((flags & 0x10) ? 'D' : '-'), // supports DSN (ACS-3)
    15481549      ((flags & 0x08) ? 'C' : '-'), // monitored condition met (ACS-3)
    static bool print_device_statistics(ata_device * device, unsigned nsectors, 
    16501651      print_device_statistics_page(pages_buf.data() + offset, page);
    16511652    }
    16521653
    1653     pout("%32s|||_ C monitored condition met\n", "");
    1654     pout("%32s||__ D supports DSN\n", "");
    1655     pout("%32s|___ N normalized value\n\n", "");
     1654    pout("%32s||||_ C monitored condition met\n", "");
     1655    pout("%32s|||__ D supports DSN\n", "");
     1656    pout("%32s||___ N normalized value\n", "");
     1657    pout("%32s|____ V valid value\n\n", "");
    16561658  }
    16571659
    16581660  return true;