From patchwork Fri Apr 8 09:52:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 65389 Delivered-To: patch@linaro.org Received: by 10.112.43.237 with SMTP id z13csp572330lbl; Fri, 8 Apr 2016 02:53:53 -0700 (PDT) X-Received: by 10.98.74.74 with SMTP id x71mr11437688pfa.25.1460109233082; Fri, 08 Apr 2016 02:53:53 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id ny6si58209pab.59.2016.04.08.02.53.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Apr 2016 02:53:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aoT5r-0002Dj-Bp; Fri, 08 Apr 2016 09:52:47 +0000 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aoT5c-0001xl-JR for linux-arm-kernel@lists.infradead.org; Fri, 08 Apr 2016 09:52:33 +0000 Received: by mail-wm0-x22e.google.com with SMTP id f198so57736070wme.0 for ; Fri, 08 Apr 2016 02:52:12 -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 :mime-version:content-transfer-encoding; bh=wQr5LD8GNq+nLUQGFgYD4/zqYVj36eiR8pRlGp0vAUY=; b=AiYgoSWjChS5VVbwRzeauU6mJ7VR8jwacS6tCUC3yRaWwz/H0XqlIudDpbVK6KWHjR RgtIfcDQFtIPBG+hrjgfP4nG21f5OxwmSR6knw8VOMKYXpFMbzlu8untSeDc5akj6aTw ammIXXFnJz2wW4e4CutyTVQjmGog4olaG1jtM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wQr5LD8GNq+nLUQGFgYD4/zqYVj36eiR8pRlGp0vAUY=; b=lvj59ffdW24uVi0kXyAiPKNWi2Ll9ARUv50lKjtXwgCIFZoChyfMhynSZukA+U76t1 PAXlQLXxQvMC35fcjIajCchXgJ+AMLUEfjIaEebGl5X991/QsbFgmrHh3Dc/f5RmuQzB 054wQVW+jVaokNDMZ1EhEpAPgFqFWMrDFTbQPLakuKfRBfM8kHMRslSCwWhUzmq1bNyE XLwQ7zoliaJHthGqpbPWqMSsm/Q2Cw1KSePDlKCPD7k8J6pPFFRfJ6VxEFP2QfrQ2RNv FMSuTQvd5zieADtQlJ6am/cnle6wzHSwjK7KMiaDhOCL9WMH9vTkESvbtBLfTaXQckz5 e9yw== X-Gm-Message-State: AD7BkJI3WJdC80h3oXSdNmik5X67YjWKpMRTOVLaUfjd9DS82NxJAt0v8AWAqd/GoLmWXEkm X-Received: by 10.28.9.71 with SMTP id 68mr2670744wmj.33.1460109131034; Fri, 08 Apr 2016 02:52:11 -0700 (PDT) Received: from localhost.localdomain ([94.18.191.146]) by smtp.gmail.com with ESMTPSA id ys9sm12580276wjc.35.2016.04.08.02.52.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 08 Apr 2016 02:52:10 -0700 (PDT) From: Christoffer Dall To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Subject: [PULL 1/4] arm64: KVM: Add braces to multi-line if statement in virtual PMU code Date: Fri, 8 Apr 2016 11:52:12 +0200 Message-Id: <1460109135-6612-2-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.1.2.330.g565301e.dirty In-Reply-To: <1460109135-6612-1-git-send-email-christoffer.dall@linaro.org> References: <1460109135-6612-1-git-send-email-christoffer.dall@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160408_025232_812959_DBCC53A4 X-CRM114-Status: GOOD ( 14.95 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:22e listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm@vger.kernel.org, Marc Zyngier , Will Deacon , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, Christoffer Dall Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org From: Will Deacon The kernel is written in C, not python, so we need braces around multi-line if statements. GCC 6 actually warns about this, thanks to the fantastic new "-Wmisleading-indentation" flag: | virt/kvm/arm/pmu.c: In function ‘kvm_pmu_overflow_status’: | virt/kvm/arm/pmu.c:198:3: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation] | reg &= vcpu_sys_reg(vcpu, PMCNTENSET_EL0); | ^~~ | arch/arm64/kvm/../../../virt/kvm/arm/pmu.c:196:2: note: ...this ‘if’ clause, but it is not | if ((vcpu_sys_reg(vcpu, PMCR_EL0) & ARMV8_PMU_PMCR_E)) | ^~ As it turns out, this particular case is harmless (we just do some &= operations with 0), but worth fixing nonetheless. Signed-off-by: Will Deacon Signed-off-by: Christoffer Dall --- virt/kvm/arm/pmu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/virt/kvm/arm/pmu.c b/virt/kvm/arm/pmu.c index b5754c6..575c7aa 100644 --- a/virt/kvm/arm/pmu.c +++ b/virt/kvm/arm/pmu.c @@ -193,11 +193,12 @@ static u64 kvm_pmu_overflow_status(struct kvm_vcpu *vcpu) { u64 reg = 0; - if ((vcpu_sys_reg(vcpu, PMCR_EL0) & ARMV8_PMU_PMCR_E)) + if ((vcpu_sys_reg(vcpu, PMCR_EL0) & ARMV8_PMU_PMCR_E)) { reg = vcpu_sys_reg(vcpu, PMOVSSET_EL0); reg &= vcpu_sys_reg(vcpu, PMCNTENSET_EL0); reg &= vcpu_sys_reg(vcpu, PMINTENSET_EL1); reg &= kvm_pmu_valid_counter_mask(vcpu); + } return reg; }