]> git.proxmox.com Git - mirror_smartmontools-debian.git/blobdiff - scsiprint.cpp
Merge tag 'upstream/6.6'
[mirror_smartmontools-debian.git] / scsiprint.cpp
index 42e43e65a4c4148871926c728ba6b3e2349abd2c..9416f23ad128bd1eec8a291ed1f24ec5ec883260 100644 (file)
@@ -40,7 +40,7 @@
 
 #define GBUF_SIZE 65535
 
-const char * scsiprint_c_cvsid = "$Id: scsiprint.cpp 4292 2016-04-12 23:06:59Z dpgilbert $"
+const char * scsiprint_c_cvsid = "$Id: scsiprint.cpp 4415 2017-03-27 21:14:53Z chrfranke $"
                                  SCSIPRINT_H_CVSID;
 
 
@@ -1205,7 +1205,6 @@ show_sas_port_param(unsigned char * ucp, int param_len)
 {
     int j, m, n, nphys, t, sz, spld_len;
     unsigned char * vcp;
-    uint64_t ull;
     char s[64];
 
     sz = sizeof(s);
@@ -1293,14 +1292,17 @@ show_sas_port_param(unsigned char * ucp, int param_len)
                !! (vcp[6] & 8), !! (vcp[6] & 4), !! (vcp[6] & 2));
         pout("    attached target port: ssp=%d stp=%d smp=%d\n",
                !! (vcp[7] & 8), !! (vcp[7] & 4), !! (vcp[7] & 2));
-        for (n = 0, ull = vcp[8]; n < 8; ++n) {
-            ull <<= 8; ull |= vcp[8 + n];
-        }
-        pout("    SAS address = 0x%" PRIx64 "\n", ull);
-        for (n = 0, ull = vcp[16]; n < 8; ++n) {
-            ull <<= 8; ull |= vcp[16 + n];
+        if (!dont_print_serial_number) {
+            uint64_t ull;
+            for (n = 0, ull = vcp[8]; n < 8; ++n) {
+                ull <<= 8; ull |= vcp[8 + n];
+            }
+            pout("    SAS address = 0x%" PRIx64 "\n", ull);
+            for (n = 0, ull = vcp[16]; n < 8; ++n) {
+                ull <<= 8; ull |= vcp[16 + n];
+            }
+            pout("    attached SAS address = 0x%" PRIx64 "\n", ull);
         }
-        pout("    attached SAS address = 0x%" PRIx64 "\n", ull);
         pout("    attached phy identifier = %d\n", vcp[24]);
         unsigned int ui;
         ui = (vcp[32] << 24) | (vcp[33] << 16) | (vcp[34] << 8) | vcp[35];
@@ -1942,13 +1944,13 @@ scsiPrintMain(scsi_device * device, const scsi_print_options & options)
     if (options.smart_enable) {
         if (scsiSmartEnable(device))
             failuretest(MANDATORY_CMD, returnval |= FAILSMART);
-            any_output = true;
+        any_output = true;
     }
 
     if (options.smart_disable) {
         if (scsiSmartDisable(device))
             failuretest(MANDATORY_CMD,returnval |= FAILSMART);
-            any_output = true;
+        any_output = true;
     }
 
     if (options.smart_auto_save_enable) {