diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2012-11-16 22:27:58 -0500 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-11-16 22:27:58 -0500 |
| commit | d05f06e60df4f56a70fb8a3e46335b40687169e9 (patch) | |
| tree | c1eec6749fed86a21b08606e1e4acefe4b033253 /lib | |
| parent | 0af1c5300db31f25a412e6e83d42b1747d56c9de (diff) | |
| parent | 1d72d9f83df057e71c7951def41138a0230bf737 (diff) | |
Merge branch 'arch-frv' into no-rebases
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/dma-debug.c | 4 | ||||
| -rw-r--r-- | lib/genalloc.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/dma-debug.c b/lib/dma-debug.c index b9087bff008b..d84beb994f36 100644 --- a/lib/dma-debug.c +++ b/lib/dma-debug.c | |||
| @@ -264,7 +264,7 @@ static struct dma_debug_entry *__hash_bucket_find(struct hash_bucket *bucket, | |||
| 264 | match_fn match) | 264 | match_fn match) |
| 265 | { | 265 | { |
| 266 | struct dma_debug_entry *entry, *ret = NULL; | 266 | struct dma_debug_entry *entry, *ret = NULL; |
| 267 | int matches = 0, match_lvl, last_lvl = 0; | 267 | int matches = 0, match_lvl, last_lvl = -1; |
| 268 | 268 | ||
| 269 | list_for_each_entry(entry, &bucket->list, list) { | 269 | list_for_each_entry(entry, &bucket->list, list) { |
| 270 | if (!match(ref, entry)) | 270 | if (!match(ref, entry)) |
| @@ -293,7 +293,7 @@ static struct dma_debug_entry *__hash_bucket_find(struct hash_bucket *bucket, | |||
| 293 | } else if (match_lvl > last_lvl) { | 293 | } else if (match_lvl > last_lvl) { |
| 294 | /* | 294 | /* |
| 295 | * We found an entry that fits better then the | 295 | * We found an entry that fits better then the |
| 296 | * previous one | 296 | * previous one or it is the 1st match. |
| 297 | */ | 297 | */ |
| 298 | last_lvl = match_lvl; | 298 | last_lvl = match_lvl; |
| 299 | ret = entry; | 299 | ret = entry; |
diff --git a/lib/genalloc.c b/lib/genalloc.c index ca208a92628c..54920433705a 100644 --- a/lib/genalloc.c +++ b/lib/genalloc.c | |||
| @@ -178,7 +178,7 @@ int gen_pool_add_virt(struct gen_pool *pool, unsigned long virt, phys_addr_t phy | |||
| 178 | struct gen_pool_chunk *chunk; | 178 | struct gen_pool_chunk *chunk; |
| 179 | int nbits = size >> pool->min_alloc_order; | 179 | int nbits = size >> pool->min_alloc_order; |
| 180 | int nbytes = sizeof(struct gen_pool_chunk) + | 180 | int nbytes = sizeof(struct gen_pool_chunk) + |
| 181 | (nbits + BITS_PER_BYTE - 1) / BITS_PER_BYTE; | 181 | BITS_TO_LONGS(nbits) * sizeof(long); |
| 182 | 182 | ||
| 183 | chunk = kmalloc_node(nbytes, GFP_KERNEL | __GFP_ZERO, nid); | 183 | chunk = kmalloc_node(nbytes, GFP_KERNEL | __GFP_ZERO, nid); |
| 184 | if (unlikely(chunk == NULL)) | 184 | if (unlikely(chunk == NULL)) |
