tcg: Return success from tcg_region_alloc__locked
Invert the sense of the boolean result from 'error' to 'success'. Tested-by: Yogesh Vyas <yvyas1991@gmail.com> Reviewed-by: Yogesh Vyas <yvyas1991@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Richard Henderson committed
Aug 12, 2026 at 16:06 UTC
e131c28b6eb24c0b7f7f21591b2b2c7568267337
1 file changed
+8
-8
tcg/region.c
+8
-8
@@ -360,11 +360,11 @@ static void tcg_region_assign(TCGContext *s, size_t curr_region)
360
static bool tcg_region_alloc__locked(TCGContext *s)
361
{
362
if (region.current == region.n) {
363
- return true;
363
+ return false;
364
}
365
tcg_region_assign(s, region.current);
366
region.current++;
367
- return false;
367
+ return true;
368
}
369
370
/*
@@ -373,17 +373,17 @@ static bool tcg_region_alloc__locked(TCGContext *s)
373
*/
374
bool tcg_region_alloc(TCGContext *s)
375
{
376
- bool err;
376
+ bool ok;
377
/* read the region size now; alloc__locked will overwrite it on success */
378
size_t size_full = s->code_gen_buffer_size;
379
380
qemu_mutex_lock(®ion.lock);
381
- err = tcg_region_alloc__locked(s);
382
- if (!err) {
381
+ ok = tcg_region_alloc__locked(s);
382
+ if (ok) {
383
region.agg_size_full += size_full - TCG_HIGHWATER;
384
}
385
qemu_mutex_unlock(®ion.lock);
386
- return err;
386
+ return !ok;
387
}
388
389
/*
@@ -392,8 +392,8 @@ bool tcg_region_alloc(TCGContext *s)
392
*/
393
static void tcg_region_initial_alloc__locked(TCGContext *s)
394
{
395
- bool err = tcg_region_alloc__locked(s);
396
- g_assert(!err);
395
+ bool ok = tcg_region_alloc__locked(s);
396
+ g_assert(ok);
397
}
398
399
void tcg_region_initial_alloc(TCGContext *s)