summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-03-17 16:21:20 +0100
committerIngo Molnar <mingo@elte.hu>2009-03-17 16:21:20 +0100
commit47239561e39bceefecc3cd67f71fcf86a198a8ff (patch)
tree9823d0973494ea8acabb744bc3aba42b610fb434 /lib
parented681a91ab805341675d166a9592551093c0a2d9 (diff)
parent5bee17f18b595937e6beafeee5197868a3f74a06 (diff)
downloadop-kernel-dev-47239561e39bceefecc3cd67f71fcf86a198a8ff.zip
op-kernel-dev-47239561e39bceefecc3cd67f71fcf86a198a8ff.tar.gz
Merge branch 'linus' into core/printk
Diffstat (limited to 'lib')
-rw-r--r--lib/Kconfig.debug2
-rw-r--r--lib/bitmap.c16
-rw-r--r--lib/idr.c2
3 files changed, 10 insertions, 10 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 29044f5..1bcf9cd 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -838,7 +838,7 @@ config FIREWIRE_OHCI_REMOTE_DMA
If unsure, say N.
-menuconfig BUILD_DOCSRC
+config BUILD_DOCSRC
bool "Build targets in Documentation/ tree"
depends on HEADERS_CHECK
help
diff --git a/lib/bitmap.c b/lib/bitmap.c
index 1338469..35a1f7f 100644
--- a/lib/bitmap.c
+++ b/lib/bitmap.c
@@ -948,15 +948,15 @@ done:
*/
int bitmap_find_free_region(unsigned long *bitmap, int bits, int order)
{
- int pos; /* scans bitmap by regions of size order */
+ int pos, end; /* scans bitmap by regions of size order */
- for (pos = 0; pos < bits; pos += (1 << order))
- if (__reg_op(bitmap, pos, order, REG_OP_ISFREE))
- break;
- if (pos == bits)
- return -ENOMEM;
- __reg_op(bitmap, pos, order, REG_OP_ALLOC);
- return pos;
+ for (pos = 0 ; (end = pos + (1 << order)) <= bits; pos = end) {
+ if (!__reg_op(bitmap, pos, order, REG_OP_ISFREE))
+ continue;
+ __reg_op(bitmap, pos, order, REG_OP_ALLOC);
+ return pos;
+ }
+ return -ENOMEM;
}
EXPORT_SYMBOL(bitmap_find_free_region);
diff --git a/lib/idr.c b/lib/idr.c
index c11c576..dab4bca 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -449,6 +449,7 @@ void idr_remove_all(struct idr *idp)
n = idp->layers * IDR_BITS;
p = idp->top;
+ rcu_assign_pointer(idp->top, NULL);
max = 1 << n;
id = 0;
@@ -467,7 +468,6 @@ void idr_remove_all(struct idr *idp)
p = *--paa;
}
}
- rcu_assign_pointer(idp->top, NULL);
idp->layers = 0;
}
EXPORT_SYMBOL(idr_remove_all);
OpenPOWER on IntegriCloud