Skip to content

Commit

Permalink
PCI: Use PCI_EXP_SLTCAP_PSN mask when extracting slot number
Browse files Browse the repository at this point in the history
Use PCI_EXP_SLTCAP_PSN mask to make it easier to find where the
Physical Slot Number is used.

The Physical Slot Number is bits 31:19 of the Slot Capabilities Register,
and slot_cap is a u32, so the mask is technically unnecessary, but it's
helpful for human readers.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
  • Loading branch information
Bjorn Helgaas committed Apr 15, 2013
1 parent 0579572 commit 545d7b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pci/hotplug/pciehp_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ static int __init dummy_probe(struct pcie_device *dev)
slot = kzalloc(sizeof(*slot), GFP_KERNEL);
if (!slot)
return -ENOMEM;
slot->number = slot_cap >> 19;
slot->number = (slot_cap & PCI_EXP_SLTCAP_PSN) >> 19;
list_for_each_entry(tmp, &dummy_slots, list) {
if (tmp->number == slot->number)
dup_slot_id++;
Expand Down

0 comments on commit 545d7b7

Please sign in to comment.