Skip to content
Snippets Groups Projects
Commit 6c3e0922 authored by ballen4705's avatar ballen4705
Browse files

Fixed formatting errors.

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@433 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent 496c3c91
Branches
No related tags found
No related merge requests found
......@@ -36,7 +36,7 @@
#define GBUF_SIZE 65535
const char* CVSid4="$Id: scsiprint.c,v 1.15 2003/01/05 15:24:44 ballen4705 Exp $"
const char* CVSid4="$Id: scsiprint.c,v 1.16 2003/01/05 23:50:17 ballen4705 Exp $"
CVSID3 CVSID4 CVSID5 CVSID6;
// control block which points to external global control variables
......@@ -236,16 +236,12 @@ void scsiPrintSelfTest(int device)
// compute page length
num = (gBuf[2] << 8) + gBuf[3];
// how come not num != 0x190 log sense wrong length?
if (num < 0x190) {
printf("Self-test Log Sense too short\n");
// Log sense page length 0x190 bytes
if (num != 0x190) {
printf("Self-test Log Sense length is 0x%x not 0x190 bytes\n",num);
exit(1);
}
// start address of first self-test result
// not needed initialized later in for () statement
// ucp = &gBuf[0] + 4;
// loop through the twenty possible entries
for (k = 0, ucp = gBuf + 4; k < 20; ++k, ucp += 20 ) {
int i;
......@@ -253,14 +249,14 @@ void scsiPrintSelfTest(int device)
// timestamp in power-on hours (or zero if test in progress)
n = (ucp[6] << 8) | ucp[7];
// if no test was done, we are finished. Should we check
// that all 20 bytes are zero?
// The spec says "all 20 bytes will be zero if no test" but
// DG has found otherwise. So this is a heuristic.
if ((0 == n) && (0 == ucp[4]))
break;
// only print header if needed
if (noheader){
printf(",\nSMART Self-test log\n");
printf("\nSMART Self-test log\n");
printf("Num Test Status segment "
"LifeTime LBA_first_err [SK ASC ASQ]\n");
printf(" Description number "
......@@ -268,9 +264,6 @@ void scsiPrintSelfTest(int device)
noheader=0;
}
// are the 20-byte blocks stored in increasing order of
// parameter code? I think so.... this code assumes it.
// print parameter code (test number) & self-test code text
printf("#%2d %s", (ucp[0] << 8) | ucp[1],
self_test_code[(ucp[4] >> 5) & 0x7]);
......@@ -305,7 +298,7 @@ void scsiPrintSelfTest(int device)
// print Address of First Failure, if sensible
if ((0xffffffffffffffffULL != ull) && (res > 0) && ( res < 0xf))
printf(" 0x%10llx", ull);
printf(" 0x%16llx", ull);
else
printf(" -");
......
......@@ -36,7 +36,7 @@
#define GBUF_SIZE 65535
const char* CVSid4="$Id: scsiprint.cpp,v 1.15 2003/01/05 15:24:44 ballen4705 Exp $"
const char* CVSid4="$Id: scsiprint.cpp,v 1.16 2003/01/05 23:50:17 ballen4705 Exp $"
CVSID3 CVSID4 CVSID5 CVSID6;
// control block which points to external global control variables
......@@ -236,16 +236,12 @@ void scsiPrintSelfTest(int device)
// compute page length
num = (gBuf[2] << 8) + gBuf[3];
// how come not num != 0x190 log sense wrong length?
if (num < 0x190) {
printf("Self-test Log Sense too short\n");
// Log sense page length 0x190 bytes
if (num != 0x190) {
printf("Self-test Log Sense length is 0x%x not 0x190 bytes\n",num);
exit(1);
}
// start address of first self-test result
// not needed initialized later in for () statement
// ucp = &gBuf[0] + 4;
// loop through the twenty possible entries
for (k = 0, ucp = gBuf + 4; k < 20; ++k, ucp += 20 ) {
int i;
......@@ -253,14 +249,14 @@ void scsiPrintSelfTest(int device)
// timestamp in power-on hours (or zero if test in progress)
n = (ucp[6] << 8) | ucp[7];
// if no test was done, we are finished. Should we check
// that all 20 bytes are zero?
// The spec says "all 20 bytes will be zero if no test" but
// DG has found otherwise. So this is a heuristic.
if ((0 == n) && (0 == ucp[4]))
break;
// only print header if needed
if (noheader){
printf(",\nSMART Self-test log\n");
printf("\nSMART Self-test log\n");
printf("Num Test Status segment "
"LifeTime LBA_first_err [SK ASC ASQ]\n");
printf(" Description number "
......@@ -268,9 +264,6 @@ void scsiPrintSelfTest(int device)
noheader=0;
}
// are the 20-byte blocks stored in increasing order of
// parameter code? I think so.... this code assumes it.
// print parameter code (test number) & self-test code text
printf("#%2d %s", (ucp[0] << 8) | ucp[1],
self_test_code[(ucp[4] >> 5) & 0x7]);
......@@ -305,7 +298,7 @@ void scsiPrintSelfTest(int device)
// print Address of First Failure, if sensible
if ((0xffffffffffffffffULL != ull) && (res > 0) && ( res < 0xf))
printf(" 0x%10llx", ull);
printf(" 0x%16llx", ull);
else
printf(" -");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment