提交 8b285ce8 编写于 作者: D David Howells 提交者: Jesse Barnes

PCI: fix pci_setup_device()'s sprinting into a const buffer

Make pci_setup_device() write the bus ID directly into the allotted storage,
rather than using pci_name() as the address as that now returns a const
pointer.
Signed-off-by: NDavid Howells <dhowells@redhat.com>
Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
上级 9433f6dd
...@@ -713,7 +713,8 @@ static int pci_setup_device(struct pci_dev * dev) ...@@ -713,7 +713,8 @@ static int pci_setup_device(struct pci_dev * dev)
{ {
u32 class; u32 class;
sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(dev->bus), snprintf(dev->dev.bus_id, BUS_ID_SIZE,
"%04x:%02x:%02x.%d", pci_domain_nr(dev->bus),
dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn)); dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
pci_read_config_dword(dev, PCI_CLASS_REVISION, &class); pci_read_config_dword(dev, PCI_CLASS_REVISION, &class);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册