From patchwork Tue Oct 10 19:29:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 9997125 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 921EB60230 for ; Tue, 10 Oct 2017 19:37:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 812CF28714 for ; Tue, 10 Oct 2017 19:37:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 751C728752; Tue, 10 Oct 2017 19:37:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 149D728714 for ; Tue, 10 Oct 2017 19:37:26 +0000 (UTC) Received: from localhost ([::1]:36821 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e20LE-00053v-R8 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 10 Oct 2017 15:37:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e20EJ-0000X8-1s for qemu-devel@nongnu.org; Tue, 10 Oct 2017 15:30:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e20EH-0004za-UA for qemu-devel@nongnu.org; Tue, 10 Oct 2017 15:30:14 -0400 Received: from mail-pf0-x233.google.com ([2607:f8b0:400e:c00::233]:45679) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e20EH-0004y9-Oc for qemu-devel@nongnu.org; Tue, 10 Oct 2017 15:30:13 -0400 Received: by mail-pf0-x233.google.com with SMTP id d28so3568998pfe.2 for ; Tue, 10 Oct 2017 12:30:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Jmmg93vGlfXYGCWPpMGtBaYKMC23pLLXYbM9fkFhyDY=; b=Q17l8FHg6TMDqhzXUYHqL2gWewq96NZccc9avk5xLllHMIoPMFQN5xBClPT8e8IHgN uo/y3pBG6KjMCsMujB93QGR0wH1ir+Q6kT9FStVgScNnCnSVvllYr89S7KbJfA1FYeAc ptCBw13KT7y8SFB77yX4gCRkKGexggSYhIZJk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Jmmg93vGlfXYGCWPpMGtBaYKMC23pLLXYbM9fkFhyDY=; b=kZp4PaNhCMNDqJK0YdpCuHTm4SgVEo11+FbuN6jff/04KkG+AA1zCQysrjaNu4Gk5A VOp0YTut4i0deNuHKyP4maDu5z2r8loUVrXjFHtqnpDpLxhs7AjNTQGMj66akm8KOBkm PA/3YEPGcZv9nw5FQqyirHXgMyoK/vYgKk2XfsbQuyzOgxAQRroTVno3KxS/mhNsAbJl a3nqisAZkoUJNjRJyvmByaDwnfNAdn6owYC/CBAuWHE8TGrb5A0I9qn336JqA5PEQpaV I/sMiEbw2ig8QuELJBrx1aVm5/vOZieMJum3T0aLJYeCArEjenlz7Eiv33PLEPmiKdyV FL7A== X-Gm-Message-State: AMCzsaXJBC33CsmIga3x6bXuGMQtO+r+PeiV537zyRRQ0VCecLJwwIkt RTJxvqmrGQVgA5Szbn4/XqwyJOWt+dA= X-Google-Smtp-Source: AOwi7QBKZapCaejHVimodMtc+4FE4eatiZ+a42KvopaOLkzZZHC63mVHbVKsV8BdeR/sxSkFvTyvhA== X-Received: by 10.101.65.129 with SMTP id a1mr13373388pgq.203.1507663812550; Tue, 10 Oct 2017 12:30:12 -0700 (PDT) Received: from bigtime.twiddle.net (97-126-104-76.tukw.qwest.net. [97.126.104.76]) by smtp.gmail.com with ESMTPSA id r22sm19859788pfl.15.2017.10.10.12.30.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Oct 2017 12:30:11 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 10 Oct 2017 12:29:48 -0700 Message-Id: <20171010193003.28857-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171010193003.28857-1-richard.henderson@linaro.org> References: <20171010193003.28857-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::233 Subject: [Qemu-devel] [PULL v2 05/20] cpu-exec: rename have_tb_lock to acquired_tb_lock in tb_find X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, "Emilio G. Cota" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: "Emilio G. Cota" Reusing the have_tb_lock name, which is also defined in translate-all.c, makes code reviewing unnecessarily harder. Avoid potential confusion by renaming the local have_tb_lock variable to something else. Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index ff6866624a..32104b8d8c 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -372,7 +372,7 @@ static inline TranslationBlock *tb_find(CPUState *cpu, TranslationBlock *tb; target_ulong cs_base, pc; uint32_t flags; - bool have_tb_lock = false; + bool acquired_tb_lock = false; /* we record a subset of the CPU state. It will always be the same before a given translated block @@ -391,7 +391,7 @@ static inline TranslationBlock *tb_find(CPUState *cpu, */ mmap_lock(); tb_lock(); - have_tb_lock = true; + acquired_tb_lock = true; /* There's a chance that our desired tb has been translated while * taking the locks so we check again inside the lock. @@ -419,15 +419,15 @@ static inline TranslationBlock *tb_find(CPUState *cpu, #endif /* See if we can patch the calling TB. */ if (last_tb && !qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN)) { - if (!have_tb_lock) { + if (!acquired_tb_lock) { tb_lock(); - have_tb_lock = true; + acquired_tb_lock = true; } if (!tb->invalid) { tb_add_jump(last_tb, tb_exit, tb); } } - if (have_tb_lock) { + if (acquired_tb_lock) { tb_unlock(); } return tb;