Skip to content

Commit

Permalink
[PATCH] Subject: PATCH: fix numa caused compile warnings
Browse files Browse the repository at this point in the history
pcibus_to_cpumask expands into more than just an initialiser so gcc
moans about code before variable declarations.

Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Alan-Cox authored and Linus Torvalds committed Sep 10, 2005
1 parent b4012a9 commit 4327edf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
10 changes: 7 additions & 3 deletions drivers/pci/pci-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,14 @@ pci_config_attr(subsystem_device, "0x%04x\n");
pci_config_attr(class, "0x%06x\n");
pci_config_attr(irq, "%u\n");

static ssize_t local_cpus_show(struct device *dev, struct device_attribute *attr, char *buf)
static ssize_t local_cpus_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
cpumask_t mask = pcibus_to_cpumask(to_pci_dev(dev)->bus);
int len = cpumask_scnprintf(buf, PAGE_SIZE-2, mask);
cpumask_t mask;
int len;

mask = pcibus_to_cpumask(to_pci_dev(dev)->bus);
len = cpumask_scnprintf(buf, PAGE_SIZE-2, mask);
strcat(buf,"\n");
return 1+len;
}
Expand Down
6 changes: 4 additions & 2 deletions drivers/pci/probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,13 @@ void pci_remove_legacy_files(struct pci_bus *bus) { return; }
/*
* PCI Bus Class Devices
*/
static ssize_t pci_bus_show_cpuaffinity(struct class_device *class_dev, char *buf)
static ssize_t pci_bus_show_cpuaffinity(struct class_device *class_dev,
char *buf)
{
cpumask_t cpumask = pcibus_to_cpumask(to_pci_bus(class_dev));
int ret;
cpumask_t cpumask;

cpumask = pcibus_to_cpumask(to_pci_bus(class_dev));
ret = cpumask_scnprintf(buf, PAGE_SIZE, cpumask);
if (ret < PAGE_SIZE)
buf[ret++] = '\n';
Expand Down

0 comments on commit 4327edf

Please sign in to comment.