* [PATCH] Fix pci_setup_device()'s sprinting into a const buffer
@ 2008-06-27 12:23 David Howells
2008-06-27 20:09 ` Jesse Barnes
0 siblings, 1 reply; 2+ messages in thread
From: David Howells @ 2008-06-27 12:23 UTC (permalink / raw)
To: torvalds, akpm, jbarnes; +Cc: linux-pci, linux-kernel, dhowells
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: David Howells <dhowells@redhat.com>
---
drivers/pci/probe.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index f829119..0420fd8 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -713,8 +713,9 @@ static int pci_setup_device(struct pci_dev * dev)
{
u32 class;
- sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(dev->bus),
- dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
+ 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));
pci_read_config_dword(dev, PCI_CLASS_REVISION, &class);
dev->revision = class & 0xff;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-06-27 20:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-27 12:23 [PATCH] Fix pci_setup_device()'s sprinting into a const buffer David Howells
2008-06-27 20:09 ` Jesse Barnes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®