lkml.org 
[lkml]   [2021]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/8] lib: bitmap: pair nbits value with region struct
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


\
 
 \ /
  Last update: 2021-02-10 17:43    [W:0.125 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site