提交 10c463a7 编写于 作者: Y Yinghai Lu 提交者: Bjorn Helgaas

PCI: Kill pci_is_reassigndev()

pci_reassigndev_resource_alignment() is the only user of
pci_is_reassigndev().  If we just use pci_specified_resource_alignment()
directly, we only need to call it once instead of twice, and we can get
rid of pci_is_reassigndev() altogether.  No functional change.

[bhelgaas: changelog]
Signed-off-by: NYinghai Lu <yinghai@kernel.org>
Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
上级 3ecd9d01
...@@ -3765,18 +3765,6 @@ resource_size_t pci_specified_resource_alignment(struct pci_dev *dev) ...@@ -3765,18 +3765,6 @@ resource_size_t pci_specified_resource_alignment(struct pci_dev *dev)
return align; return align;
} }
/**
* pci_is_reassigndev - check if specified PCI is target device to reassign
* @dev: the PCI device to check
*
* RETURNS: non-zero for PCI device is a target device to reassign,
* or zero is not.
*/
int pci_is_reassigndev(struct pci_dev *dev)
{
return (pci_specified_resource_alignment(dev) != 0);
}
/* /*
* This function disables memory decoding and releases memory resources * This function disables memory decoding and releases memory resources
* of the device specified by kernel's boot parameter 'pci=resource_alignment='. * of the device specified by kernel's boot parameter 'pci=resource_alignment='.
...@@ -3791,7 +3779,9 @@ void pci_reassigndev_resource_alignment(struct pci_dev *dev) ...@@ -3791,7 +3779,9 @@ void pci_reassigndev_resource_alignment(struct pci_dev *dev)
resource_size_t align, size; resource_size_t align, size;
u16 command; u16 command;
if (!pci_is_reassigndev(dev)) /* check if specified PCI is target device to reassign */
align = pci_specified_resource_alignment(dev);
if (!align)
return; return;
if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL && if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL &&
...@@ -3807,7 +3797,6 @@ void pci_reassigndev_resource_alignment(struct pci_dev *dev) ...@@ -3807,7 +3797,6 @@ void pci_reassigndev_resource_alignment(struct pci_dev *dev)
command &= ~PCI_COMMAND_MEMORY; command &= ~PCI_COMMAND_MEMORY;
pci_write_config_word(dev, PCI_COMMAND, command); pci_write_config_word(dev, PCI_COMMAND, command);
align = pci_specified_resource_alignment(dev);
for (i = 0; i < PCI_BRIDGE_RESOURCES; i++) { for (i = 0; i < PCI_BRIDGE_RESOURCES; i++) {
r = &dev->resource[i]; r = &dev->resource[i];
if (!(r->flags & IORESOURCE_MEM)) if (!(r->flags & IORESOURCE_MEM))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册