lkml.org 
[lkml]   [2013]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] regmap: Cut down on the average # of nodes in the rbtree cache
On Wed, Mar 13, 2013 at 11:53:43AM +0000, Dimitris Papastamos wrote:

> + for (bitmap_size = 0, i = 0; i < map->num_reg_defaults; i++)
> + if (map->reg_defaults[i].reg > bitmap_size)
> + bitmap_size = map->reg_defaults[i].reg;
> + bitmap_size++;
> +
> + reg_bitmap = kmalloc(BITS_TO_LONGS(bitmap_size) * sizeof(long),
> + GFP_KERNEL);
> + if (!reg_bitmap) {
> + ret = -ENOMEM;
> + goto err;
> + }
> + bitmap_zero(reg_bitmap, bitmap_size);
> + rbtree_ctx->reg_bitmap = reg_bitmap;
> + rbtree_ctx->reg_bitmap_nbits = bitmap_size;
> +

What happens if we don't have any register defaults?

This also needs a clearer name reflecting the function rather than the
type of the data.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2013-03-13 13:21    [W:0.037 / U:0.900 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site