lkml.org 
[lkml]   [2014]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH next 3/4] blk-mq: user (1 << order) to implement order_to_size()
Ming Lei wrote, on 04/17/2014 17:49:
> Signed-off-by: Ming Lei <tom.leiming@gmail.com>
> ---
> block/blk-mq.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index baff2d0..1eff3d9 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -1130,12 +1130,7 @@ static void blk_mq_free_rq_map(struct blk_mq_tag_set *set,
>
> static size_t order_to_size(unsigned int order)
> {
> - size_t ret = PAGE_SIZE;
> -
> - while (order--)
> - ret *= 2;
> -
> - return ret;
> + return (1 << order) * PAGE_SIZE;

Shouldn't this be

return ((size_t)1 << order) * PAGE_SIZE;

?
> }
>
> static struct blk_mq_tags *blk_mq_init_rq_map(struct blk_mq_tag_set *set,
>

Regards,
jvp.



\
 
 \ /
  Last update: 2014-04-17 21:41    [W:0.069 / U:3.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site