Skip to contentSkip to conversation

bnx2i: fix the bit manipulation when setting the error mask

PATCH In review Tomas Henzl 2 participants 3 messages Jul 3, 2012 – Dec 11, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bnx2i: fix the bit manipulation when setting the error mask

The intention in bnx2i_send_fw_iscsi_init_msg was to zero out only the lower 32bits, but instead the whole mask64 is zeroed. This patch fixes it.

---

drivers/scsi/bnx2i/bnx2i_hwi.c +1 -1
index ece47e5..1cbf402 100644
@@ -1314,7 +1314,7 @@ int bnx2i_send_fw_iscsi_init_msg(struct bnx2i_hba *hba)
 		(1ULL << ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_LUN));
 	if (error_mask1) {
 		iscsi_init2.error_bit_map[0] = error_mask1;
-		mask64 &= (u32)(~mask64);
+		mask64 ^= (u32)(mask64);
 		mask64 |= error_mask1;
 	} else
 		iscsi_init2.error_bit_map[0] = (u32) mask64;
Acked-by on v1 1/1
#1 lore raw
Quoted 14 lines · Tomas Henzl

The intention in bnx2i_send_fw_iscsi_init_msg was to zero out only the lower 32bits, but instead the whole mask64 is zeroed. This patch fixes it.

---

drivers/scsi/bnx2i/bnx2i_hwi.c +0 -0
index ece47e5..1cbf402 100644

drivers/scsi/bnx2i/bnx2i_hwi.c int bnx2i_send_fw_iscsi_init_msg(struct bnx2i_hba *hba) · line 1320

Quoted 8 lines
drivers/scsi/bnx2i/bnx2i_hwi.c +1 -1
@@ -1314,7 +1314,7 @@ int bnx2i_send_fw_iscsi_init_msg(struct bnx2i_hba *hba)
 		(1ULL << ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_LUN));
 	if (error_mask1) {
 		iscsi_init2.error_bit_map[0] = error_mask1;
-		mask64 &= (u32)(~mask64);
+		mask64 ^= (u32)(mask64);
 		mask64 |= error_mask1;
 	} else
 		iscsi_init2.error_bit_map[0] = (u32) mask64;

Looks good. Thanks.

#2 lore raw
In reply to Tomas Henzl

Hello James,

I'm re-sending this patch fix by Tomas as it hasn't made it upstream yet in any of the trees.

Thanks,
Eddie

Quoted 22 lines · Tomas Henzl

The intention in bnx2i_send_fw_iscsi_init_msg was to zero out only the lower 32bits, but instead the whole mask64 is zeroed. This patch fixes it.

---

drivers/scsi/bnx2i/bnx2i_hwi.c +1 -1
index ece47e5..1cbf402 100644
@@ -1314,7 +1314,7 @@ int bnx2i_send_fw_iscsi_init_msg(struct bnx2i_hba *hba)
 		(1ULL << ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_LUN));
 	if (error_mask1) {
 		iscsi_init2.error_bit_map[0] = error_mask1;
-		mask64 &= (u32)(~mask64);
+		mask64 ^= (u32)(mask64);
 		mask64 |= error_mask1;
 	} else
 		iscsi_init2.error_bit_map[0] = (u32) mask64;