From: Andrew Morton Date: Thu, 26 Jun 2014 00:42:33 +0000 (+1000) Subject: dma-cma-support-arbitrary-bitmap-granularity-fix X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c8bc272078e1991ba4e7e050a959e16faebb55d9;p=karo-tx-linux.git dma-cma-support-arbitrary-bitmap-granularity-fix s/1/1UL/ Cc: Alexander Graf Cc: Aneesh Kumar K.V Cc: Gleb Natapov Cc: Joonsoo Kim Acked-by: Marek Szyprowski Tested-by: Marek Szyprowski Cc: Michal Nazarewicz Cc: Minchan Kim Cc: Paolo Bonzini Cc: Zhang Yanfei Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Signed-off-by: Andrew Morton --- diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c index c6eeb2ca5585..ad8a85bf852f 100644 --- a/drivers/base/dma-contiguous.c +++ b/drivers/base/dma-contiguous.c @@ -160,7 +160,7 @@ static DEFINE_MUTEX(cma_mutex); static unsigned long cma_bitmap_aligned_mask(struct cma *cma, int align_order) { - return (1 << (align_order >> cma->order_per_bit)) - 1; + return (1UL << (align_order >> cma->order_per_bit)) - 1; } static unsigned long cma_bitmap_maxno(struct cma *cma) @@ -171,7 +171,7 @@ static unsigned long cma_bitmap_maxno(struct cma *cma) static unsigned long cma_bitmap_pages_to_bits(struct cma *cma, unsigned long pages) { - return ALIGN(pages, 1 << cma->order_per_bit) >> cma->order_per_bit; + return ALIGN(pages, 1UL << cma->order_per_bit) >> cma->order_per_bit; } static void cma_clear_bitmap(struct cma *cma, unsigned long pfn, int count)