From: Richard Henderson <[email protected]>

Invert the sense of the boolean result from 'error' to 'success'.

Tested-by: Yogesh Vyas <[email protected]>
Reviewed-by: Yogesh Vyas <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
(cherry picked from commit fcdbc78ad4dea4b6baac581be5f7350ce47dc218)
Signed-off-by: Michael Tokarev <[email protected]>

diff --git a/tcg/region.c b/tcg/region.c
index 3721a7a7e16..087e47f40d2 100644
--- a/tcg/region.c
+++ b/tcg/region.c
@@ -369,7 +369,7 @@ static bool tcg_region_alloc__locked(TCGContext *s)
 
 /*
  * Request a new region once the one in use has filled up.
- * Returns true on error.
+ * Returns true on success.
  */
 bool tcg_region_alloc(TCGContext *s)
 {
@@ -383,7 +383,7 @@ bool tcg_region_alloc(TCGContext *s)
         region.agg_size_full += size_full - TCG_HIGHWATER;
     }
     qemu_mutex_unlock(&region.lock);
-    return !ok;
+    return ok;
 }
 
 /*
diff --git a/tcg/tcg.c b/tcg/tcg.c
index b1a7465df28..d2e5cfd9077 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -1575,7 +1575,7 @@ TranslationBlock *tcg_tb_alloc(TCGContext *s)
     next = (void *)ROUND_UP((uintptr_t)(tb + 1), align);
 
     if (unlikely(next > s->code_gen_highwater)) {
-        if (tcg_region_alloc(s)) {
+        if (!tcg_region_alloc(s)) {
             return NULL;
         }
         goto retry;
-- 
2.47.3


Reply via email to