Re: [PATCH] mm-cma-add-functions-to-get-region-pages-counters-fix-3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 08 2015, Dmitry Safonov <d.safonov@xxxxxxxxxxxxxxxxxxx> wrote:
> Fix for the next compiler warnings:
> mm/cma_debug.c:45 cma_used_get() warn: should 'used << cma->order_per_bit' be a 64 bit type?
> mm/cma_debug.c:67 cma_maxchunk_get() warn: should 'maxchunk << cma->order_per_bit' be a 64 bit type?
>
> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Cc: Michal Nazarewicz <mina86@xxxxxxxxxx>

Acked-by: Michal Nazarewicz <mina86@xxxxxxxxxx>

> Cc: Stefan Strogin <stefan.strogin@xxxxxxxxx>
> Cc: Marek Szyprowski <m.szyprowski@xxxxxxxxxxx>
> Cc: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx>
> Cc: Pintu Kumar <pintu.k@xxxxxxxxxxx>
> Cc: Weijie Yang <weijie.yang@xxxxxxxxxxx>
> Cc: Laurent Pinchart <laurent.pinchart+renesas@xxxxxxxxxxxxxxxx>
> Cc: Vyacheslav Tyrtov <v.tyrtov@xxxxxxxxxxx>
> Cc: Aleksei Mateosian <a.mateosian@xxxxxxxxxxx>
> Cc: Sasha Levin <sasha.levin@xxxxxxxxxx>
> Cc: Michal Hocko <mhocko@xxxxxxx>
> Signed-off-by: Dmitry Safonov <d.safonov@xxxxxxxxxxxxxxxxxxx>
> ---
>  mm/cma_debug.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/cma_debug.c b/mm/cma_debug.c
> index 835e761..9459842 100644
> --- a/mm/cma_debug.c
> +++ b/mm/cma_debug.c
> @@ -42,7 +42,7 @@ static int cma_used_get(void *data, u64 *val)
>  	/* pages counter is smaller than sizeof(int) */
>  	used = bitmap_weight(cma->bitmap, (int)cma->count);
>  	mutex_unlock(&cma->lock);
> -	*val = used << cma->order_per_bit;
> +	*val = (u64)used << cma->order_per_bit;
>  
>  	return 0;
>  }
> @@ -64,7 +64,7 @@ static int cma_maxchunk_get(void *data, u64 *val)
>  		maxchunk = max(end - start, maxchunk);
>  	}
>  	mutex_unlock(&cma->lock);
> -	*val = maxchunk << cma->order_per_bit;
> +	*val = (u64)maxchunk << cma->order_per_bit;
>  
>  	return 0;
>  }
> -- 
> 2.3.5
>

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +--<mpn@xxxxxxxxxx>--<xmpp:mina86@xxxxxxxxxx>--ooO--(_)--Ooo--

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]