diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/iommu-helper.c | 8 | ||||
-rw-r--r-- | lib/ratelimit.c | 3 | ||||
-rw-r--r-- | lib/smp_processor_id.c | 5 |
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 | } |
82 | EXPORT_SYMBOL(iommu_area_free); | 82 | EXPORT_SYMBOL(iommu_area_free); |
83 | |||
84 | unsigned 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 | } | ||
90 | 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 @@ | |||
15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
16 | 16 | ||
17 | static DEFINE_SPINLOCK(ratelimit_lock); | 17 | static DEFINE_SPINLOCK(ratelimit_lock); |
18 | static 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 | */ |
27 | int __ratelimit(struct ratelimit_state *rs) | 26 | int __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 | /* |