Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp12082228ybi; Fri, 26 Jul 2019 04:30:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqy0cLokbWUiQSVmg4MCowDds8BL0AqsjXWUAIjqEZXHpXa9ZOtcD+zv3vvgruPeKAYJRidD X-Received: by 2002:a17:902:9b94:: with SMTP id y20mr95669661plp.260.1564140629976; Fri, 26 Jul 2019 04:30:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564140629; cv=none; d=google.com; s=arc-20160816; b=oDHa70v0wcjA76iJx9baWE0kDvYQAPp3njnpOg3toByWR1QvPiYgxfJwEVM2BGwc7C ET/9J7mCeRO3N2+pXuSdcoPF538J/Cnw69Ai1I4iKmEFz9kNqpgI6jdHfstdK254Dp7v UOhPAh4t1T4T2WHRKgNxZE4Nrt+7ZdeY3NEhyIVATF1JVYC9ZBpT4X9Hy7wxC2+nnOQb FKlANNEqLUKYDWXVAeVGnoWKGD9pbTb+39nGWJCJL/s3UedrjChN8FLtpqqbfzi3o5FP lZ11Qwhy8aInRc2TSPkTDOnKT5DOfSwXxMbWbbBR7gibMCDu7BoQWTNIXroA86iv3bZs LqKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=9u9CYuUvpswbH949bqEBTSxc6yUDGnUSUcquJxjAfws=; b=AXCxSTVj289pLCVhv+loA35sujBTMWri2xDdnbC8zzWfgsSwUmdeRx/j93Rs/3CY76 wVK+kVaiFNGCf6AP0byMDKvXy9lMj9Y5OawEQkKdkB/kYpWP3Hwq9q2Mgh/znbgIA9by wdHOdCaF+vmnVaKrLDuNg9fQQw+/pUupvjoQS7ItDVqWpMPNaNDKO9qtJtNynHtikhjz IhZmckBqarAIktHbYItcUa7+RD+6VUnYO3SQgPBXuC2o9rMstp1ZEYWXyVCtIXXElI7x qzeFgtp+cKb26iVw+CxV185WTiHKZuryQ7M7JUgf7V596Nx6Hta9fOVukI7eKXp1SNch dDMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Qs5hDsYN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c8si22500706pje.30.2019.07.26.04.30.14; Fri, 26 Jul 2019 04:30:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Qs5hDsYN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727122AbfGZL2j (ORCPT + 99 others); Fri, 26 Jul 2019 07:28:39 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:37060 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726124AbfGZL2i (ORCPT ); Fri, 26 Jul 2019 07:28:38 -0400 Received: by mail-lj1-f194.google.com with SMTP id z28so51232211ljn.4 for ; Fri, 26 Jul 2019 04:28:36 -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:mime-version :content-transfer-encoding; bh=9u9CYuUvpswbH949bqEBTSxc6yUDGnUSUcquJxjAfws=; b=Qs5hDsYNRU3XsuhsUT5LoYh9H2yYIMx8duYxg6mWxxWMAUMbImQG+9HQrXaPkuZOWU NQ3JDWVRtBVse7vWN0EQedlArPeIP+VdKG/kcW22GMeAK0D8Rvz8puGSqcrmRNxxl1BF fZbTCesF+1uP4QoRJYi9h+LByxF/lRIdJoEJKRyKCMGiVK4AWoUclwfptVFmgD7O1xLm /WUXnq2XphbPUvCXVip34slPxmd0gU/1DukG9h40JCr+RigFMot1JveTXCyQQhRWmAo1 3tvAZ1TaMuU8J/twMpxD+F9W9uzynrED2rNHzMAozJZR9YKUn7YY+6p4uTXvYdh5DKkB CGfg== 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:mime-version :content-transfer-encoding; bh=9u9CYuUvpswbH949bqEBTSxc6yUDGnUSUcquJxjAfws=; b=mu0Wqc3dP8TBJAKxAZp8uppRaX/jWHCNn0cAIExAbnumsIACcCbA9vP3MUabYqAU6p q9driOOuPkHN/RTuP9zInar+GSxWKh4iPvWFeKyOyrr/MHdvScfoe2TbbDlzFBiNLwCC NlMiUwCJP+SzS9DMKuqe/mxafyVZSCkrK5nCgKnEcVzWt/cGIX0iKkEuGNpN+r79Cwgr vm3uuNoK8SJHnbkIlNVGS3moguuACKu/ywca3/qTrfwxnISszhqvswvlK9/RWfkw/9ce kygyfEJuJha66fh0pCCWu1EWsyTssAw4AgA7F8QCe0C3M9K6Fzu40kiuWwA94mCJevz5 XuRg== X-Gm-Message-State: APjAAAUlB+lSd8By0k4g15eEkznWcxFFCJjHg4++VZwsNfReeztpcgvh i6DuzvK2dJinxGcTvCmQ9/5qHYA24bG9aA== X-Received: by 2002:a2e:9685:: with SMTP id q5mr34535218lji.227.1564140515726; Fri, 26 Jul 2019 04:28:35 -0700 (PDT) Received: from localhost (c-243c70d5.07-21-73746f28.bbcust.telenor.se. [213.112.60.36]) by smtp.gmail.com with ESMTPSA id k23sm5390909ljg.90.2019.07.26.04.28.34 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 26 Jul 2019 04:28:35 -0700 (PDT) From: Anders Roxell To: maz@kernel.org Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, Anders Roxell Subject: [PATCH] KVM: arm: vgic-v3: Mark expected switch fall-through Date: Fri, 26 Jul 2019 13:28:31 +0200 Message-Id: <20190726112831.19878-1-anders.roxell@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When fall-through warnings was enabled by default the following warnings was starting to show up: ../virt/kvm/arm/hyp/vgic-v3-sr.c: In function ‘__vgic_v3_save_aprs’: ../virt/kvm/arm/hyp/vgic-v3-sr.c:351:24: warning: this statement may fall through [-Wimplicit-fallthrough=] cpu_if->vgic_ap0r[2] = __vgic_v3_read_ap0rn(2); ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ ../virt/kvm/arm/hyp/vgic-v3-sr.c:352:2: note: here case 6: ^~~~ ../virt/kvm/arm/hyp/vgic-v3-sr.c:353:24: warning: this statement may fall through [-Wimplicit-fallthrough=] cpu_if->vgic_ap0r[1] = __vgic_v3_read_ap0rn(1); ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ ../virt/kvm/arm/hyp/vgic-v3-sr.c:354:2: note: here default: ^~~~~~~ Rework so that the compiler doesn't warn about fall-through. Fixes: d93512ef0f0e ("Makefile: Globally enable fall-through warning") Signed-off-by: Anders Roxell --- virt/kvm/arm/hyp/vgic-v3-sr.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/virt/kvm/arm/hyp/vgic-v3-sr.c b/virt/kvm/arm/hyp/vgic-v3-sr.c index 254c5f190a3d..ccf1fde9836c 100644 --- a/virt/kvm/arm/hyp/vgic-v3-sr.c +++ b/virt/kvm/arm/hyp/vgic-v3-sr.c @@ -349,8 +349,10 @@ void __hyp_text __vgic_v3_save_aprs(struct kvm_vcpu *vcpu) case 7: cpu_if->vgic_ap0r[3] = __vgic_v3_read_ap0rn(3); cpu_if->vgic_ap0r[2] = __vgic_v3_read_ap0rn(2); + /* Fall through */ case 6: cpu_if->vgic_ap0r[1] = __vgic_v3_read_ap0rn(1); + /* Fall through */ default: cpu_if->vgic_ap0r[0] = __vgic_v3_read_ap0rn(0); } @@ -359,8 +361,10 @@ void __hyp_text __vgic_v3_save_aprs(struct kvm_vcpu *vcpu) case 7: cpu_if->vgic_ap1r[3] = __vgic_v3_read_ap1rn(3); cpu_if->vgic_ap1r[2] = __vgic_v3_read_ap1rn(2); + /* Fall through */ case 6: cpu_if->vgic_ap1r[1] = __vgic_v3_read_ap1rn(1); + /* Fall through */ default: cpu_if->vgic_ap1r[0] = __vgic_v3_read_ap1rn(0); } @@ -382,8 +386,10 @@ void __hyp_text __vgic_v3_restore_aprs(struct kvm_vcpu *vcpu) case 7: __vgic_v3_write_ap0rn(cpu_if->vgic_ap0r[3], 3); __vgic_v3_write_ap0rn(cpu_if->vgic_ap0r[2], 2); + /* Fall through */ case 6: __vgic_v3_write_ap0rn(cpu_if->vgic_ap0r[1], 1); + /* Fall through */ default: __vgic_v3_write_ap0rn(cpu_if->vgic_ap0r[0], 0); } @@ -392,8 +398,10 @@ void __hyp_text __vgic_v3_restore_aprs(struct kvm_vcpu *vcpu) case 7: __vgic_v3_write_ap1rn(cpu_if->vgic_ap1r[3], 3); __vgic_v3_write_ap1rn(cpu_if->vgic_ap1r[2], 2); + /* Fall through */ case 6: __vgic_v3_write_ap1rn(cpu_if->vgic_ap1r[1], 1); + /* Fall through */ default: __vgic_v3_write_ap1rn(cpu_if->vgic_ap1r[0], 0); } -- 2.20.1