Skip to contentSkip to conversation

suspicious self-assignment in lpfc

PATCH Dave Jones 2 participants 2 messages Feb 18, 2014 – Feb 20, 2014

Subsystems (2)
lore
Share & tools
lore

Dave Jones

author
#0 lore raw

Looking through coverity reports, and it flagged lpfc_read_fcf_conn_tbl() due to the following patch..

commit df0d085fdd2e7c39d1249c2d4ad6b3e176efb60c

Author: James Smart <[email protected]>
Date:   Fri May 31 17:05:08 2013 -0400

[SCSI] lpfc 8.3.40: Fixed FCoE connection list vlan identifier and add FCF list debug

drivers/scsi/lpfc/lpfc_hbadisc.c +2 -2
index 0f6e2548f35d..0309cc15aad6 100644
@@ -6158,12 +6158,44 @@ lpfc_read_fcf_conn_tbl(struct lpfc_hba *phba,
                memcpy(&conn_entry->conn_rec, &conn_rec[i],
                        sizeof(struct lpfc_fcf_conn_rec));
                conn_entry->conn_rec.vlan_tag =
-                       le16_to_cpu(conn_entry->conn_rec.vlan_tag) & 0xFFF;
+                       conn_entry->conn_rec.vlan_tag;
                conn_entry->conn_rec.flags =
-                       le16_to_cpu(conn_entry->conn_rec.flags);
+                       conn_entry->conn_rec.flags;
                list_add_tail(&conn_entry->list,
                        &phba->fcf_conn_rec_list);
 
 

Now that we're not caring about endianness, those two assignments are redundant. I gather this has passed testing, because surely someone would have complained by now, but can they be removed, or should they be doing something else entirely ?

Dave

#1 lore raw

yeah - this is pretty silly. I'll cut a patch to remove the lines.

-- james s

Quoted 37 lines · Dave Jones

Looking through coverity reports, and it flagged lpfc_read_fcf_conn_tbl() due to the following patch..

commit df0d085fdd2e7c39d1249c2d4ad6b3e176efb60c

Author: James Smart <[email protected]>
Date:   Fri May 31 17:05:08 2013 -0400

[SCSI] lpfc 8.3.40: Fixed FCoE connection list vlan identifier and add FCF list debug

drivers/scsi/lpfc/lpfc_hbadisc.c +2 -2
index 0f6e2548f35d..0309cc15aad6 100644
@@ -6158,12 +6158,44 @@ lpfc_read_fcf_conn_tbl(struct lpfc_hba *phba,
                 memcpy(&conn_entry->conn_rec, &conn_rec[i],
                         sizeof(struct lpfc_fcf_conn_rec));
                 conn_entry->conn_rec.vlan_tag =
-                       le16_to_cpu(conn_entry->conn_rec.vlan_tag) & 0xFFF;
+                       conn_entry->conn_rec.vlan_tag;
                 conn_entry->conn_rec.flags =
-                       le16_to_cpu(conn_entry->conn_rec.flags);
+                       conn_entry->conn_rec.flags;
                 list_add_tail(&conn_entry->list,
                         &phba->fcf_conn_rec_list);
 
 

Now that we're not caring about endianness, those two assignments are redundant. I gather this has passed testing, because surely someone would have complained by now, but can they be removed, or should they be doing something else entirely ?

Dave