Richard Henderson <richard.hender...@linaro.org> writes:
> A size is easier to work with than an end point, > particularly during initial buffer allocation. > > Signed-off-by: Richard Henderson <richard.hender...@linaro.org> > --- > tcg/region.c | 29 +++++++++++++++++------------ > 1 file changed, 17 insertions(+), 12 deletions(-) > > diff --git a/tcg/region.c b/tcg/region.c > index 9a1e039824..a17f342f38 100644 > --- a/tcg/region.c > +++ b/tcg/region.c > @@ -48,7 +48,7 @@ struct tcg_region_state { > /* fields set at init time */ > void *start; > void *start_aligned; > - void *end; > + size_t total_size; /* size of entire buffer */ > size_t n; > size_t size; /* size of one region */ > size_t stride; /* .size + guard size */ I'd shuffle that to the end so it scans size < stride < total_size. I see we have special handling bellow: > @@ -279,7 +279,7 @@ static void tcg_region_bounds(size_t curr_region, void > **pstart, void **pend) > start = region.start; > } > if (curr_region == region.n - 1) { > - end = region.end; > + end = region.start_aligned + region.total_size; So why isn't this end = start_aligned + (n * stride)? do we not line up for the last region? Anyway: Reviewed-by: Alex Bennée <alex.ben...@linaro.org> -- Alex Bennée