iscsi-target: remove always-true conditions
authorJoern Engel <joern@logfs.org>
Tue, 2 Sep 2014 21:49:50 +0000 (17:49 -0400)
committerNicholas Bellinger <nab@linux-iscsi.org>
Wed, 17 Sep 2014 20:19:16 +0000 (13:19 -0700)
Found by coverity.  InitiatorName and InitiatorAlias are static arrays
and therefore always non-NULL.  At some point in the past they may have
been dynamically allocated, but for current code the condition is
useless.  If the intent was to check InitiatorName[0] instead, I cannot
find a use for that either.  Let's get rid of it.

Signed-off-by: Joern Engel <joern@logfs.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/iscsi/iscsi_target_configfs.c

index ae03f3e5de1e47f8ce9bb43ae134361d8e9e325a..9059c1e0b26e559dc0c1f69b3b97625d7cb806e4 100644 (file)
@@ -669,12 +669,10 @@ static ssize_t lio_target_nacl_show_info(
        } else {
                sess = se_sess->fabric_sess_ptr;
 
-               if (sess->sess_ops->InitiatorName)
-                       rb += sprintf(page+rb, "InitiatorName: %s\n",
-                               sess->sess_ops->InitiatorName);
-               if (sess->sess_ops->InitiatorAlias)
-                       rb += sprintf(page+rb, "InitiatorAlias: %s\n",
-                               sess->sess_ops->InitiatorAlias);
+               rb += sprintf(page+rb, "InitiatorName: %s\n",
+                       sess->sess_ops->InitiatorName);
+               rb += sprintf(page+rb, "InitiatorAlias: %s\n",
+                       sess->sess_ops->InitiatorAlias);
 
                rb += sprintf(page+rb, "LIO Session ID: %u   "
                        "ISID: 0x%02x %02x %02x %02x %02x %02x  "