Skip to content
Snippets Groups Projects
Commit 524688fe authored by shattered's avatar shattered
Browse files

Use the same wording in comments :-) Also, note why NetBSD needs special

handling in format_ata_string().


git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@2395 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent 7015e051
No related branches found
No related tags found
No related merge requests found
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#include "extern.h" #include "extern.h"
#include "utility.h" #include "utility.h"
const char *atacmds_c_cvsid="$Id: atacmds.cpp,v 1.183 2007/02/23 20:44:00 chrfranke Exp $" const char *atacmds_c_cvsid="$Id: atacmds.cpp,v 1.184 2007/04/14 08:57:47 shattered Exp $"
ATACMDS_H_CVSID CONFIG_H_CVSID EXTERN_H_CVSID INT64_H_CVSID SCSIATA_H_CVSID UTILITY_H_CVSID; ATACMDS_H_CVSID CONFIG_H_CVSID EXTERN_H_CVSID INT64_H_CVSID SCSIATA_H_CVSID UTILITY_H_CVSID;
// to hold onto exit code for atexit routine // to hold onto exit code for atexit routine
...@@ -700,7 +700,7 @@ int ataReadHDIdentity (int device, struct ata_identify_device *buf){ ...@@ -700,7 +700,7 @@ int ataReadHDIdentity (int device, struct ata_identify_device *buf){
#ifndef __NetBSD__ #ifndef __NetBSD__
// if machine is big-endian, swap byte order as needed // if machine is big-endian, swap byte order as needed
// (the NetBSD kernel does deliver the results in host byte order) // NetBSD kernel delivers IDENTIFY data in host byte order
if (isbigendian()){ if (isbigendian()){
int i; int i;
...@@ -843,7 +843,7 @@ int ataReadSmartValues(int device, struct ata_smart_values *data){ ...@@ -843,7 +843,7 @@ int ataReadSmartValues(int device, struct ata_smart_values *data){
if (checksum((unsigned char *)data)) if (checksum((unsigned char *)data))
checksumwarning("SMART Attribute Data Structure"); checksumwarning("SMART Attribute Data Structure");
// byte swap if needed // swap endian order if needed
if (isbigendian()){ if (isbigendian()){
int i; int i;
swap2((char *)&(data->revnumber)); swap2((char *)&(data->revnumber));
...@@ -895,7 +895,7 @@ int ataReadSelfTestLog (int device, struct ata_smart_selftestlog *data){ ...@@ -895,7 +895,7 @@ int ataReadSelfTestLog (int device, struct ata_smart_selftestlog *data){
if (con->fixfirmwarebug == FIX_SAMSUNG) if (con->fixfirmwarebug == FIX_SAMSUNG)
fixsamsungselftestlog(data); fixsamsungselftestlog(data);
// fix endian order, if needed // swap endian order if needed
if (isbigendian()){ if (isbigendian()){
int i; int i;
swap2((char*)&(data->revnumber)); swap2((char*)&(data->revnumber));
...@@ -1186,7 +1186,7 @@ int ataReadErrorLog (int device, struct ata_smart_errorlog *data){ ...@@ -1186,7 +1186,7 @@ int ataReadErrorLog (int device, struct ata_smart_errorlog *data){
else if (con->fixfirmwarebug == FIX_SAMSUNG2) else if (con->fixfirmwarebug == FIX_SAMSUNG2)
fixsamsungerrorlog2(data); fixsamsungerrorlog2(data);
// Correct endian order if necessary // swap endian order if needed
if (isbigendian()){ if (isbigendian()){
int i,j; int i,j;
...@@ -1219,7 +1219,7 @@ int ataReadSmartThresholds (int device, struct ata_smart_thresholds_pvt *data){ ...@@ -1219,7 +1219,7 @@ int ataReadSmartThresholds (int device, struct ata_smart_thresholds_pvt *data){
if (checksum((unsigned char *)data)) if (checksum((unsigned char *)data))
checksumwarning("SMART Attribute Thresholds Structure"); checksumwarning("SMART Attribute Thresholds Structure");
// byte swap if needed // swap endian order if needed
if (isbigendian()) if (isbigendian())
swap2((char *)&(data->revnumber)); swap2((char *)&(data->revnumber));
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
#include "utility.h" #include "utility.h"
#include "knowndrives.h" #include "knowndrives.h"
const char *ataprint_c_cvsid="$Id: ataprint.cpp,v 1.179 2007/04/05 18:23:29 shattered Exp $" const char *ataprint_c_cvsid="$Id: ataprint.cpp,v 1.180 2007/04/14 08:57:47 shattered Exp $"
ATACMDNAMES_H_CVSID ATACMDS_H_CVSID ATAPRINT_H_CVSID CONFIG_H_CVSID EXTERN_H_CVSID INT64_H_CVSID KNOWNDRIVES_H_CVSID SMARTCTL_H_CVSID UTILITY_H_CVSID; ATACMDNAMES_H_CVSID ATACMDS_H_CVSID ATAPRINT_H_CVSID CONFIG_H_CVSID EXTERN_H_CVSID INT64_H_CVSID KNOWNDRIVES_H_CVSID SMARTCTL_H_CVSID UTILITY_H_CVSID;
// for passing global control variables // for passing global control variables
...@@ -99,6 +99,7 @@ void format_ata_string(char *out, const char *in, int n) ...@@ -99,6 +99,7 @@ void format_ata_string(char *out, const char *in, int n)
#ifndef __NetBSD__ #ifndef __NetBSD__
swapbytes(tmp, in, n); swapbytes(tmp, in, n);
#else #else
/* NetBSD kernel delivers IDENTIFY data in host byte order (but all else is LE) */
if (isbigendian()) if (isbigendian())
strncpy(tmp, in, n); strncpy(tmp, in, n);
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment