]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm/cma.c: suppress warning
authorAndrew Morton <akpm@linux-foundation.org>
Wed, 21 Oct 2015 22:03:19 +0000 (09:03 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 21 Oct 2015 22:03:19 +0000 (09:03 +1100)
mm/cma.c: In function 'cma_alloc':
mm/cma.c:366: warning: 'pfn' may be used uninitialized in this function

The patch actually improves the tracing a bit: if alloc_contig_range()
fails, tracing will display the offending pfn rather than -1.

Cc: Stefan Strogin <stefan.strogin@gmail.com>
Cc: Michal Nazarewicz <mpn@google.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Cc: Thierry Reding <treding@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/cma.c

index 4eb56badf37e60e63a5a1badd093d1934a21ad35..ea506eb18cd6b2cff00606a6c1e1387b48099ffa 100644 (file)
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -363,7 +363,9 @@ err:
  */
 struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align)
 {
-       unsigned long mask, offset, pfn, start = 0;
+       unsigned long mask, offset;
+       unsigned long pfn = -1;
+       unsigned long start = 0;
        unsigned long bitmap_maxno, bitmap_no, bitmap_count;
        struct page *page = NULL;
        int ret;
@@ -418,7 +420,7 @@ struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align)
                start = bitmap_no + mask + 1;
        }
 
-       trace_cma_alloc(page ? pfn : -1UL, page, count, align);
+       trace_cma_alloc(pfn, page, count, align);
 
        pr_debug("%s(): returned %p\n", __func__, page);
        return page;