X-Git-Url: http://git.monstr.eu/?a=blobdiff_plain;f=lib%2Fpercpu_counter.c;h=00f666d944867773f6c9d02587e9dcd449b5b303;hb=48342fc07272eec454fc5b400ed3ce3739c7e950;hp=a2345de90e937bad64e00bf62a224f9f3e6732b4;hpb=05909cd9a0c8811731b38697af13075e8954314f;p=linux-2.6-microblaze.git diff --git a/lib/percpu_counter.c b/lib/percpu_counter.c index a2345de90e93..00f666d94486 100644 --- a/lib/percpu_counter.c +++ b/lib/percpu_counter.c @@ -17,7 +17,7 @@ static DEFINE_SPINLOCK(percpu_counters_lock); #ifdef CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER -static struct debug_obj_descr percpu_counter_debug_descr; +static const struct debug_obj_descr percpu_counter_debug_descr; static bool percpu_counter_fixup_free(void *addr, enum debug_obj_state state) { @@ -33,7 +33,7 @@ static bool percpu_counter_fixup_free(void *addr, enum debug_obj_state state) } } -static struct debug_obj_descr percpu_counter_debug_descr = { +static const struct debug_obj_descr percpu_counter_debug_descr = { .name = "percpu_counter", .fixup_free = percpu_counter_fixup_free, }; @@ -85,7 +85,7 @@ void percpu_counter_add_batch(struct percpu_counter *fbc, s64 amount, s32 batch) preempt_disable(); count = __this_cpu_read(*fbc->counters) + amount; - if (count >= batch || count <= -batch) { + if (abs(count) >= batch) { unsigned long flags; raw_spin_lock_irqsave(&fbc->lock, flags); fbc->count += count;