Skip to contentSkip to conversation

i40e: Fix bit logic error in failure case

PATCH New Dave Ertman 2 participants 2 messages Sep 30, 2016 – Oct 3, 2016

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

PATCH 1/1 i40e: Fix bit logic error in failure case

Patch a036244c0686 "i40e: Fix kernel panic on enable/disable LLDP" introduced an error in bit logic.

Originally this bit manipulation was meant to clear two bits to indicate that DCB was not enabled or capable. An "&" was incorrectly used instead of an "|" bit operator to combine the two bitmasks into one. This also created a static checker error since the resultant code was a no-op.

This patch fixes the error by using the correct bit-wise operator.

---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -1
index 8176596..bf68dd7 100644
@@ -10955,7 +10955,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	err = i40e_init_pf_dcb(pf);
 	if (err) {
 		dev_info(&pdev->dev, "DCB init failed %d, disabled\n", err);
-		pf->flags &= ~(I40E_FLAG_DCB_CAPABLE & I40E_FLAG_DCB_ENABLED);
+		pf->flags &= ~(I40E_FLAG_DCB_CAPABLE | I40E_FLAG_DCB_ENABLED);
 		/* Continue without DCB enabled */
 	}
 #endif /* CONFIG_I40E_DCB */
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 i40e: Fix bit logic error in failure case

Quoted 15 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Dave Ertman
Sent: Friday, September 30, 2016 1:36 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH] i40e: Fix bit logic error in failure case

Patch a036244c0686 "i40e: Fix kernel panic on enable/disable LLDP" introduced an error in bit logic.

Originally this bit manipulation was meant to clear two bits to indicate that DCB was not enabled or capable. An "&" was incorrectly used instead of an "|" bit operator to combine the two bitmasks into one. This also created a static checker error since the resultant code was a no-op.

Quoted 7 lines

This patch fixes the error by using the correct bit-wise operator.

---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)