Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI: Use PCI_EXP_SLTCAP_PSN mask when extracting slot number

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>

+1 -1
+1 -1
drivers/pci/hotplug/pciehp_acpi.c
··· 90 90 slot = kzalloc(sizeof(*slot), GFP_KERNEL); 91 91 if (!slot) 92 92 return -ENOMEM; 93 - slot->number = slot_cap >> 19; 93 + slot->number = (slot_cap & PCI_EXP_SLTCAP_PSN) >> 19; 94 94 list_for_each_entry(tmp, &dummy_slots, list) { 95 95 if (tmp->number == slot->number) 96 96 dup_slot_id++;