Skip to contentSkip to conversation

x86, cpu: intel_cacheinfo.c: use cpumask_first(to_cpumask())

tip:x86/cpu Langsdorf, Mark 1 participant 1 message Mar 18, 2009 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Thanks!

Quoted 61 lines

-----Original Message-----
From: H. Peter Anvin [mailto:[email protected]]
Sent: Wednesday, March 18, 2009 4:43 PM
To: [email protected]
Cc: [email protected]; [email protected]; Langsdorf, Mark; [email protected]; [email protected]
Subject: [tip:x86/cpu] x86, cpu: intel_cacheinfo.c: use cpumask_first(to_cpumask())

Commit-ID: d42c33ef0a236c6874c748438500c78edfaa1187 Gitweb:
http://git.kernel.org/tip/d42c33ef0a236c6874c748438500c78edfaa1187

Author:     H. Peter Anvin <[email protected]>
AuthorDate: Wed, 18 Mar 2009 14:36:02 -0700
Committer:  H. Peter Anvin <[email protected]>
CommitDate: Wed, 18 Mar 2009 14:38:36 -0700

x86, cpu: intel_cacheinfo.c: use cpumask_first(to_cpumask())

Impact: fix warning and possible UP build failure

Instead of using first_cpu() on a raw bitmask, use cpumask_first(to_cpumask()).

---
 arch/x86/kernel/cpu/intel_cacheinfo.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
arch/x86/kernel/cpu/intel_cacheinfo.c +2 -1
index b728325..6f4d2a3 100644
@@ -643,7 +643,8 @@ static ssize_t show_##file_name		
 				\
 static ssize_t show_cache_disable(struct _cpuid4_info 
 *this_leaf, char *buf,
 		 unsigned int index)
 {
-	int node = cpu_to_node(first_cpu(this_leaf->shared_cpu_map));
+	int cpu = cpumask_first(to_cpumask(this_leaf->shared_cpu_map));
+	int node = cpu_to_node(cpu);
 	struct pci_dev *dev = k8_northbridges[node];
arch/x86/kernel/cpu/intel_cacheinfo.c +2 -1
 	unsigned int reg = 0;
@@ -665,7 +666,8 @@ static ssize_t
 store_cache_disable(struct _cpuid4_info *this_leaf, const char *buf,
 		 size_t count, unsigned int index)
 {
-	int node = cpu_to_node(first_cpu(this_leaf->shared_cpu_map));
+	int cpu = cpumask_first(to_cpumask(this_leaf->shared_cpu_map));
+	int node = cpu_to_node(cpu);
 	struct pci_dev *dev = k8_northbridges[node];
 	unsigned long val = 0;
 	unsigned int scrubber = 0;