Re: [PATCH 5/8] lib: bitmap: pair nbits value with region struct

From: Andy Shevchenko
Date: Wed Feb 10 2021 - 11:40:50 EST


On Tue, Feb 09, 2021 at 05:59:04PM -0500, Paul Gortmaker wrote:
> A region is a standalone entity to some degree, but it needs to
> be paired with a bitmap width in order to set context and determine
> if the region even fits into the width of the bitmap.
>
> This will reduce parameter passing and enable using nbits as part
> of future dynamic region parameter parsing.

...

> +struct bitmap_region {
> + struct region *r;

Why do we need it as a pointer?

> + unsigned int nbits;
> +};

...

> struct region r;
> + struct bitmap_region br;

> + br.r = &r;
> + br.nbits = nmaskbits;

I thought about simply

struct bitmap_region br;

br.nbits = nmaskbits;

--
With Best Regards,
Andy Shevchenko