Skip to contentSkip to conversation

hotplug/shpchp_hpc: add parenthesis in SLOT_REG_RSVDZ_MASK

PATCH In review Dan Carpenter 2 participants 2 messages May 26, 2010

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

PATCH 1/1 hotplug/shpchp_hpc: add parenthesis in SLOT_REG_RSVDZ_MASK

The SLOT_REG_RSVDZ_MASK macro is normally used like this:

	slot_reg &= ~SLOT_REG_RSVDZ_MASK;

The ~ operator has higher precedence than the | operator from inside the macro, so it needs parenthesis.

drivers/pci/hotplug/shpchp_hpc.c +1 -1
index 5f5e8d2..d3985e7 100644
@@ -113,7 +113,7 @@
 #define CON_PFAULT_INTR_MASK	(1 << 28)
 #define MRL_CHANGE_SERR_MASK	(1 << 29)
 #define CON_PFAULT_SERR_MASK	(1 << 30)
-#define SLOT_REG_RSVDZ_MASK	(1 << 15) | (7 << 21)
+#define SLOT_REG_RSVDZ_MASK	((1 << 15) | (7 << 21))
 
 /*
  * SHPC Command Code definitnions
Reviewed-by on v1 1/1
#1 lore raw

Good catch.

Quoted 26 lines · Dan Carpenter

The SLOT_REG_RSVDZ_MASK macro is normally used like this:

	slot_reg&= ~SLOT_REG_RSVDZ_MASK;

The ~ operator has higher precedence than the | operator from inside the macro, so it needs parenthesis.

drivers/pci/hotplug/shpchp_hpc.c +1 -2
index 5f5e8d2..d3985e7 100644
@@ -113,7 +113,7 @@
  #define CON_PFAULT_INTR_MASK	(1<<  28)
  #define MRL_CHANGE_SERR_MASK	(1<<  29)
  #define CON_PFAULT_SERR_MASK	(1<<  30)
-#define SLOT_REG_RSVDZ_MASK	(1<<  15) | (7<<  21)
+#define SLOT_REG_RSVDZ_MASK	((1<<  15) | (7<<  21))
 
  /*
   * SHPC Command Code definitnions
--

To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html