From patchwork Fri Jul 26 11:28:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 169825 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp12909954ilk; Fri, 26 Jul 2019 04:28:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqxyAs+C+uHnQ+c4jV0OgKDmiQ5g5Z+QHdr3ABZxMAxGu9D9ZLVALzWfNh4Ng6o5vt5wTF2M X-Received: by 2002:a63:506:: with SMTP id 6mr89682546pgf.434.1564140521099; Fri, 26 Jul 2019 04:28:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564140521; cv=none; d=google.com; s=arc-20160816; b=L31PBiYbhgnxHnGbtsuvIeIoNfyTnQvbItHNFl3BIzEGJzv/JwW4Y6hsXfC5IMwwbh t+WwfnpU8YaJq4Wq2/HamV0k+6BfLYxNPz7yYE6gIfBVFGBK8T9JZu+Dfx4rPTYwHHM3 Hk3rUHjZ499Qqe4oiE8sntv1ooPSzIl8cbltEah7rxHukk0om3wybjAd8MZs3PHzadeP OJ3L0QKAtgUnKB/CLd1AD8Q1XebHFgn6+QfNRwA4BB5GntvQtQlGkh3KQzRzzsiNvjrt p5r6zDxxEMqpbQyfZ/W6Zvb8GVk5AeCxcF09pZuyrwkKCGLU44qOr7dV6xDE4+YQl0VX Dx7Q== 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 t6si17608441pjv.14.2019.07.26.04.28.40; Fri, 26 Jul 2019 04:28:41 -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 S1727127AbfGZL2j (ORCPT + 29 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 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(+) -- 2.20.1 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); }