tcg: Return success from tcg_region_alloc
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:08 UTC
fcdbc78ad4dea4b6baac581be5f7350ce47dc218
2 files changed
+3
-3
tcg/region.c
+2
-2
@@ -369,7 +369,7 @@ static bool tcg_region_alloc__locked(TCGContext *s)
369
370
/*
371
* Request a new region once the one in use has filled up.
372
- * Returns true on error.
372
+ * Returns true on success.
373
*/
374
bool tcg_region_alloc(TCGContext *s)
375
{
@@ -383,7 +383,7 @@ bool tcg_region_alloc(TCGContext *s)
383
region.agg_size_full += size_full - TCG_HIGHWATER;
384
}
385
qemu_mutex_unlock(®ion.lock);
386
- return !ok;
386
+ return ok;
387
}
388
389
/*
tcg/tcg.c
+1
-1
@@ -1835,7 +1835,7 @@ TranslationBlock *tcg_tb_alloc(TCGContext *s)
1835
next = (void *)ROUND_UP((uintptr_t)(tb + 1), align);
1836
1837
if (unlikely(next > s->code_gen_highwater)) {
1838
- if (tcg_region_alloc(s)) {
1838
+ if (!tcg_region_alloc(s)) {
1839
return NULL;
1840
}
1841
goto retry;