aboutsummaryrefslogtreecommitdiffstats
path: root/mm/cma.c
diff options
context:
space:
mode:
authorJoonsoo Kim <iamjoonsoo.kim@lge.com>2014-08-06 19:05:30 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-06 21:01:16 -0400
commitb7155e76a702d97553660828347b9f10858b4dd5 (patch)
tree90ff541b79089e61d20276d28df13adda200fdff /mm/cma.c
parentfc95ca7284bc54953165cba76c3228bd2cdb9591 (diff)
mm, CMA: clean-up CMA allocation error path
We can remove one call sites for clear_cma_bitmap() if we first call it before checking error number. Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com> Acked-by: Minchan Kim <minchan@kernel.org> Reviewed-by: Michal Nazarewicz <mina86@mina86.com> Reviewed-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Cc: Alexander Graf <agraf@suse.de> Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Cc: Gleb Natapov <gleb@kernel.org> Acked-by: Marek Szyprowski <m.szyprowski@samsung.com> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/cma.c')
-rw-r--r--mm/cma.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mm/cma.c b/mm/cma.c
index 656004216953..103a6663b7c7 100644
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -285,11 +285,12 @@ struct page *cma_alloc(struct cma *cma, int count, unsigned int align)
285 if (ret == 0) { 285 if (ret == 0) {
286 page = pfn_to_page(pfn); 286 page = pfn_to_page(pfn);
287 break; 287 break;
288 } else if (ret != -EBUSY) {
289 cma_clear_bitmap(cma, pfn, count);
290 break;
291 } 288 }
289
292 cma_clear_bitmap(cma, pfn, count); 290 cma_clear_bitmap(cma, pfn, count);
291 if (ret != -EBUSY)
292 break;
293
293 pr_debug("%s(): memory range at %p is busy, retrying\n", 294 pr_debug("%s(): memory range at %p is busy, retrying\n",
294 __func__, pfn_to_page(pfn)); 295 __func__, pfn_to_page(pfn));
295 /* try again with a bit different memory target */ 296 /* try again with a bit different memory target */