Skip to contentSkip to conversation

r82600_edac: '&' vs '|' typo

RFC In review Dan Carpenter 2 participants 2 messages Aug 23, 2013 – Aug 24, 2013

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

RFC 1/1 r82600_edac: '&' vs '|' typo

This is a shot in the dark. Doing the & here seems like not correct because "0x1 & 0x2" is zero. I think '|' is probably intended because that's often the case with these.

But this is just a guess.

I'd prefer to leave it the same if no one knows for sure what we're trying to do here.

drivers/edac/r82600_edac.c +4 -4
index 2fd6a54..656eab6 100644
@@ -146,14 +146,14 @@ static void r82600_get_error_info(struct mem_ctl_info *mci,
 	if (info->eapr & BIT(0))
 		/* Clear error to allow next error to be reported [p.62] */
 		pci_write_bits32(pdev, R82600_EAP,
-				 ((u32) BIT(0) & (u32) BIT(1)),
-				 ((u32) BIT(0) & (u32) BIT(1)));
+				 ((u32) BIT(0) | (u32) BIT(1)),
+				 ((u32) BIT(0) | (u32) BIT(1)));
 
 	if (info->eapr & BIT(1))
 		/* Clear error to allow next error to be reported [p.62] */
 		pci_write_bits32(pdev, R82600_EAP,
-				 ((u32) BIT(0) & (u32) BIT(1)),
-				 ((u32) BIT(0) & (u32) BIT(1)));
+				 ((u32) BIT(0) | (u32) BIT(1)),
+				 ((u32) BIT(0) | (u32) BIT(1)));
 }
 
 static int r82600_process_error_info(struct mem_ctl_info *mci,
Acked-by on v1 1/1
#1 lore raw

Yes, this looks like my error. I still have a copy of the data sheet, but no access to this hardware to test, but this fix looks like what I must have intended.

Tim.

Quoted 32 lines · Dan Carpenter

This is a shot in the dark. Doing the & here seems like not correct because "0x1 & 0x2" is zero. I think '|' is probably intended because that's often the case with these.

But this is just a guess.

I'd prefer to leave it the same if no one knows for sure what we're trying to do here.

drivers/edac/r82600_edac.c +4 -4
index 2fd6a54..656eab6 100644
@@ -146,14 +146,14 @@ static void r82600_get_error_info(struct mem_ctl_info *mci,
 	if (info->eapr & BIT(0))
 		/* Clear error to allow next error to be reported [p.62] */
 		pci_write_bits32(pdev, R82600_EAP,
-				 ((u32) BIT(0) & (u32) BIT(1)),
-				 ((u32) BIT(0) & (u32) BIT(1)));
+				 ((u32) BIT(0) | (u32) BIT(1)),
+				 ((u32) BIT(0) | (u32) BIT(1)));
 
 	if (info->eapr & BIT(1))
 		/* Clear error to allow next error to be reported [p.62] */
 		pci_write_bits32(pdev, R82600_EAP,
-				 ((u32) BIT(0) & (u32) BIT(1)),
-				 ((u32) BIT(0) & (u32) BIT(1)));
+				 ((u32) BIT(0) | (u32) BIT(1)),
+				 ((u32) BIT(0) | (u32) BIT(1)));
 }
 
 static int r82600_process_error_info(struct mem_ctl_info *mci,