aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-07-31 06:38:04 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-31 06:38:04 -0400
commit5fbf24659b75356e2142e1f1b88f67b34cbc3e75 (patch)
tree0e470e4cc89b72e3d74939f8c39396a6a0bebb3a /lib
parentd89961e2dc87b6e30b8e3f60bd2af5cd92cf4643 (diff)
parent6e86841d05f371b5b9b86ce76c02aaee83352298 (diff)
Merge branch 'linus' into x86/xen
Diffstat (limited to 'lib')
-rw-r--r--lib/iommu-helper.c8
-rw-r--r--lib/ratelimit.c3
-rw-r--r--lib/smp_processor_id.c5
3 files changed, 11 insertions, 5 deletions
diff --git a/lib/iommu-helper.c b/lib/iommu-helper.c
index a3b8d4c3f77a..889ddce2021e 100644
--- a/lib/iommu-helper.c
+++ b/lib/iommu-helper.c
@@ -80,3 +80,11 @@ void iommu_area_free(unsigned long *map, unsigned long start, unsigned int nr)
80 } 80 }
81} 81}
82EXPORT_SYMBOL(iommu_area_free); 82EXPORT_SYMBOL(iommu_area_free);
83
84unsigned long iommu_num_pages(unsigned long addr, unsigned long len)
85{
86 unsigned long size = roundup((addr & ~PAGE_MASK) + len, PAGE_SIZE);
87
88 return size >> PAGE_SHIFT;
89}
90EXPORT_SYMBOL(iommu_num_pages);
diff --git a/lib/ratelimit.c b/lib/ratelimit.c
index 35136671b215..26187edcc7ea 100644
--- a/lib/ratelimit.c
+++ b/lib/ratelimit.c
@@ -15,7 +15,6 @@
15#include <linux/module.h> 15#include <linux/module.h>
16 16
17static DEFINE_SPINLOCK(ratelimit_lock); 17static DEFINE_SPINLOCK(ratelimit_lock);
18static unsigned long flags;
19 18
20/* 19/*
21 * __ratelimit - rate limiting 20 * __ratelimit - rate limiting
@@ -26,6 +25,8 @@ static unsigned long flags;
26 */ 25 */
27int __ratelimit(struct ratelimit_state *rs) 26int __ratelimit(struct ratelimit_state *rs)
28{ 27{
28 unsigned long flags;
29
29 if (!rs->interval) 30 if (!rs->interval)
30 return 1; 31 return 1;
31 32
diff --git a/lib/smp_processor_id.c b/lib/smp_processor_id.c
index c4381d9516f6..0f8fc22ed103 100644
--- a/lib/smp_processor_id.c
+++ b/lib/smp_processor_id.c
@@ -11,7 +11,6 @@ notrace unsigned int debug_smp_processor_id(void)
11{ 11{
12 unsigned long preempt_count = preempt_count(); 12 unsigned long preempt_count = preempt_count();
13 int this_cpu = raw_smp_processor_id(); 13 int this_cpu = raw_smp_processor_id();
14 cpumask_of_cpu_ptr_declare(this_mask);
15 14
16 if (likely(preempt_count)) 15 if (likely(preempt_count))
17 goto out; 16 goto out;
@@ -23,9 +22,7 @@ notrace unsigned int debug_smp_processor_id(void)
23 * Kernel threads bound to a single CPU can safely use 22 * Kernel threads bound to a single CPU can safely use
24 * smp_processor_id(): 23 * smp_processor_id():
25 */ 24 */
26 cpumask_of_cpu_ptr_next(this_mask, this_cpu); 25 if (cpus_equal(current->cpus_allowed, cpumask_of_cpu(this_cpu)))
27
28 if (cpus_equal(current->cpus_allowed, *this_mask))
29 goto out; 26 goto out;
30 27
31 /* 28 /*