Print this page
10132 smatch fixes for MDB
Reviewed by: Andy Fiddaman <andy@omniosce.org>

@@ -20,11 +20,11 @@
  */
 /*
  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  *
- * FCP mdb module
+ * Copyright (c) 2018, Joyent, Inc.
  */
 
 
 #include <sys/mdb_modapi.h>
 #include <sys/mutex.h>

@@ -326,12 +326,12 @@
                 return (WALK_ERR);
         }
 
         tgt_hash_index = 0;
 
-        while ((port.port_tgt_hash_table[tgt_hash_index] == NULL) &&
-            (tgt_hash_index < FCP_NUM_HASH)) {
+        while (tgt_hash_index < FCP_NUM_HASH &&
+            port.port_tgt_hash_table[tgt_hash_index] == NULL) {
                 tgt_hash_index++;
         }
 
         wsp->walk_addr = (uintptr_t)(port.port_tgt_hash_table[tgt_hash_index]);
 

@@ -367,14 +367,13 @@
                  * locate the next hash list
                  */
 
                 tgt_hash_index++;
 
-                while ((port.port_tgt_hash_table[tgt_hash_index] == NULL) &&
-                    (tgt_hash_index < FCP_NUM_HASH)) {
+                while (tgt_hash_index < FCP_NUM_HASH &&
+                    port.port_tgt_hash_table[tgt_hash_index] == NULL)
                         tgt_hash_index++;
-                }
 
                 if (tgt_hash_index == FCP_NUM_HASH) {
                         /* You're done */
                         return (status);
                 }