summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-07-31 12:38:04 +0200
committerIngo Molnar <mingo@elte.hu>2008-07-31 12:38:04 +0200
commit5fbf24659b75356e2142e1f1b88f67b34cbc3e75 (patch)
tree0e470e4cc89b72e3d74939f8c39396a6a0bebb3a /lib
parentd89961e2dc87b6e30b8e3f60bd2af5cd92cf4643 (diff)
parent6e86841d05f371b5b9b86ce76c02aaee83352298 (diff)
downloadlinux-5fbf24659b75356e2142e1f1b88f67b34cbc3e75.tar.gz
linux-5fbf24659b75356e2142e1f1b88f67b34cbc3e75.tar.bz2
linux-5fbf24659b75356e2142e1f1b88f67b34cbc3e75.zip
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)
}
}
EXPORT_SYMBOL(iommu_area_free);
+
+unsigned long iommu_num_pages(unsigned long addr, unsigned long len)
+{
+ unsigned long size = roundup((addr & ~PAGE_MASK) + len, PAGE_SIZE);
+
+ return size >> PAGE_SHIFT;
+}
+EXPORT_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 @@
#include <linux/module.h>
static DEFINE_SPINLOCK(ratelimit_lock);
-static unsigned long flags;
/*
* __ratelimit - rate limiting
@@ -26,6 +25,8 @@ static unsigned long flags;
*/
int __ratelimit(struct ratelimit_state *rs)
{
+ unsigned long flags;
+
if (!rs->interval)
return 1;
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)
{
unsigned long preempt_count = preempt_count();
int this_cpu = raw_smp_processor_id();
- cpumask_of_cpu_ptr_declare(this_mask);
if (likely(preempt_count))
goto out;
@@ -23,9 +22,7 @@ notrace unsigned int debug_smp_processor_id(void)
* Kernel threads bound to a single CPU can safely use
* smp_processor_id():
*/
- cpumask_of_cpu_ptr_next(this_mask, this_cpu);
-
- if (cpus_equal(current->cpus_allowed, *this_mask))
+ if (cpus_equal(current->cpus_allowed, cpumask_of_cpu(this_cpu)))
goto out;
/*