[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080627122320.29319.14707.stgit@warthog.procyon.org.uk>
Date: Fri, 27 Jun 2008 13:23:20 +0100
From: David Howells <dhowells@...hat.com>
To: torvalds@...l.org, akpm@...ux-foundation.org,
jbarnes@...tuousgeek.org
Cc: linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
dhowells@...hat.com
Subject: [PATCH] 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: David Howells <dhowells@...hat.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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists