pci cpumask: remove local cpumask_t's from the stack
cover pci cpumask: remove local cpumask_t's from the stack
Rebased against linux-next/master (v2.6.28-rc8-5814-g8dba8f5)>
*** Note these are also in tip/cpus4096 at:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git
branch: cpus4096
588235b: cpumask: update pci_bus_show_cpuaffinity to use new cpumask API 3be8305: cpumask: update local_cpus_show to use new cpumask API
(Perhaps "git-pulling" them from there is a better method?)
PATCH 1/2 cpumask: update local_cpus_show to use new cpumask API
Impact: cleanup, reduce stack usage, use new cpumask API.
Replace the local cpumask_t variable with a pointer to the const cpumask that needs to be printed.
--- drivers/pci/pci-sysfs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/pci/pci-sysfs.c +6 -6
@@ -70,11 +70,11 @@ static ssize_t broken_parity_status_storstatic ssize_t local_cpus_show (struct device *dev,struct device_attribute *attr,char *buf) { -cpumask_t mask; +const struct cpumask *mask;int len; - mask =pcibus_to_cpumask (to_pci_dev (dev)->bus); - len =cpumask_scnprintf (buf,PAGE_SIZE -2 , &mask); + mask =cpumask_of_pcibus (to_pci_dev (dev)->bus); + len =cpumask_scnprintf (buf,PAGE_SIZE -2 , mask); buf[len++] ='\n' ; buf[len] ='\0' ;return len;
@@ -84,11 +84,11 @@ static ssize_t local_cpus_show(struct destatic ssize_t local_cpulist_show (struct device *dev,struct device_attribute *attr,char *buf) { -cpumask_t mask; +const struct cpumask *mask;int len; - mask =pcibus_to_cpumask (to_pci_dev (dev)->bus); - len =cpulist_scnprintf (buf,PAGE_SIZE -2 , &mask); + mask =cpumask_of_pcibus (to_pci_dev (dev)->bus); + len =cpulist_scnprintf (buf,PAGE_SIZE -2 , mask); buf[len++] ='\n' ; buf[len] ='\0' ;return len;
Re: [PATCH 1/2] cpumask: update local_cpus_show to use new cpumask API
Quoted 10 lines · Mike Travis
Impact: cleanup, reduce stack usage, use new cpumask API.
Replace the local
cpumask_tvariable with a pointer to the const cpumask that needs to be printed.Signed-off-by Mike Travis <[email protected]>Cc Jesse Barnes <[email protected]>--- drivers/pci/pci-sysfs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
Hm, clearly there are other patches in Ingo's tree that this depends on, since this patch assumes the presence of cpumask_of_pcibus and has slightly different cpumask_scnprintf context. I'll just let Ingo push the whole thing.
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
Re: [PATCH 1/2] cpumask: update local_cpus_show to use new cpumask API
Quoted 12 lines · Jesse Barnes
Quoted 10 lines · Mike Travis
Impact: cleanup, reduce stack usage, use new cpumask API.
Replace the local
cpumask_tvariable with a pointer to the const cpumask that needs to be printed.Signed-off-by Mike Travis <[email protected]>Cc Jesse Barnes <[email protected]>--- drivers/pci/pci-sysfs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
Quoted 4 lines
Hm, clearly there are other patches in Ingo's tree that this depends on, since this patch assumes the presence of
cpumask_of_pcibusand has slightly differentcpumask_scnprintfcontext. I'll just let Ingo push the whole thing.
Ok, thanks. I saw that but I *think* all of this is in Linus' tree.
Cheers,
Mike
Re: [PATCH 1/2] cpumask: update local_cpus_show to use new cpumask API
In reply to Jesse BarnesQuoted 12 lines · Jesse Barnes
Quoted 10 lines · Mike Travis
Impact: cleanup, reduce stack usage, use new cpumask API.
Replace the local
cpumask_tvariable with a pointer to the const cpumask that needs to be printed.Signed-off-by Mike Travis <[email protected]>Cc Jesse Barnes <[email protected]>--- drivers/pci/pci-sysfs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
Quoted 4 lines
Hm, clearly there are other patches in Ingo's tree that this depends on, since this patch assumes the presence of
cpumask_of_pcibusand has slightly differentcpumask_scnprintfcontext. I'll just let Ingo push the whole thing.
okay, will push them to Linus.
Ingo
PATCH 2/2 cpumask: update pci_bus_show_cpuaffinity to use new cpumask API
In reply to Mike TravisImpact: cleanup, reduce stack usage, use new cpumask API.
Replace the local cpumask_t variable with a pointer to the const cpumask that needs to be printed.
--- drivers/pci/probe.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/pci/probe.c +4 -4
@@ -51,12 +51,12 @@ static ssize_t pci_bus_show_cpuaffinity( char *buf) {int ret; -cpumask_t cpumask; +const struct cpumask *cpumask; - cpumask =pcibus_to_cpumask (to_pci_bus (dev)); + cpumask =cpumask_of_pcibus (to_pci_bus (dev)); ret = type? -cpulist_scnprintf (buf,PAGE_SIZE -2 , &cpumask) : -cpumask_scnprintf (buf,PAGE_SIZE -2 , &cpumask); +cpulist_scnprintf (buf,PAGE_SIZE -2 , cpumask) : +cpumask_scnprintf (buf,PAGE_SIZE -2 , cpumask); buf[ret++] ='\n' ; buf[ret] ='\0' ;return ret;