lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190728231949.6874-1-mcroce@redhat.com>
Date:   Mon, 29 Jul 2019 01:19:49 +0200
From:   Matteo Croce <mcroce@...hat.com>
To:     linux-arm-kernel@...ts.infradead.org
Cc:     Marc Zyngier <maz@...nel.org>,
        Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will@...nel.org>, linux-kernel@...r.kernel.org
Subject: [PATCH] KVM: arm64: mark expected switch fall-through in HYP

Mark switch cases where we are expecting to fall through,
fixes a 130+ lines warning.

Signed-off-by: Matteo Croce <mcroce@...hat.com>
---
 arch/arm64/kvm/hyp/debug-sr.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/arch/arm64/kvm/hyp/debug-sr.c b/arch/arm64/kvm/hyp/debug-sr.c
index 26781da3ad3e..c648c243f98b 100644
--- a/arch/arm64/kvm/hyp/debug-sr.c
+++ b/arch/arm64/kvm/hyp/debug-sr.c
@@ -18,40 +18,70 @@
 #define save_debug(ptr,reg,nr)						\
 	switch (nr) {							\
 	case 15:	ptr[15] = read_debug(reg, 15);			\
+			/* fallthrough */				\
 	case 14:	ptr[14] = read_debug(reg, 14);			\
+			/* fallthrough */				\
 	case 13:	ptr[13] = read_debug(reg, 13);			\
+			/* fallthrough */				\
 	case 12:	ptr[12] = read_debug(reg, 12);			\
+			/* fallthrough */				\
 	case 11:	ptr[11] = read_debug(reg, 11);			\
+			/* fallthrough */				\
 	case 10:	ptr[10] = read_debug(reg, 10);			\
+			/* fallthrough */				\
 	case 9:		ptr[9] = read_debug(reg, 9);			\
+			/* fallthrough */				\
 	case 8:		ptr[8] = read_debug(reg, 8);			\
+			/* fallthrough */				\
 	case 7:		ptr[7] = read_debug(reg, 7);			\
+			/* fallthrough */				\
 	case 6:		ptr[6] = read_debug(reg, 6);			\
+			/* fallthrough */				\
 	case 5:		ptr[5] = read_debug(reg, 5);			\
+			/* fallthrough */				\
 	case 4:		ptr[4] = read_debug(reg, 4);			\
+			/* fallthrough */				\
 	case 3:		ptr[3] = read_debug(reg, 3);			\
+			/* fallthrough */				\
 	case 2:		ptr[2] = read_debug(reg, 2);			\
+			/* fallthrough */				\
 	case 1:		ptr[1] = read_debug(reg, 1);			\
+			/* fallthrough */				\
 	default:	ptr[0] = read_debug(reg, 0);			\
 	}
 
 #define restore_debug(ptr,reg,nr)					\
 	switch (nr) {							\
 	case 15:	write_debug(ptr[15], reg, 15);			\
+			/* fallthrough */				\
 	case 14:	write_debug(ptr[14], reg, 14);			\
+			/* fallthrough */				\
 	case 13:	write_debug(ptr[13], reg, 13);			\
+			/* fallthrough */				\
 	case 12:	write_debug(ptr[12], reg, 12);			\
+			/* fallthrough */				\
 	case 11:	write_debug(ptr[11], reg, 11);			\
+			/* fallthrough */				\
 	case 10:	write_debug(ptr[10], reg, 10);			\
+			/* fallthrough */				\
 	case 9:		write_debug(ptr[9], reg, 9);			\
+			/* fallthrough */				\
 	case 8:		write_debug(ptr[8], reg, 8);			\
+			/* fallthrough */				\
 	case 7:		write_debug(ptr[7], reg, 7);			\
+			/* fallthrough */				\
 	case 6:		write_debug(ptr[6], reg, 6);			\
+			/* fallthrough */				\
 	case 5:		write_debug(ptr[5], reg, 5);			\
+			/* fallthrough */				\
 	case 4:		write_debug(ptr[4], reg, 4);			\
+			/* fallthrough */				\
 	case 3:		write_debug(ptr[3], reg, 3);			\
+			/* fallthrough */				\
 	case 2:		write_debug(ptr[2], reg, 2);			\
+			/* fallthrough */				\
 	case 1:		write_debug(ptr[1], reg, 1);			\
+			/* fallthrough */				\
 	default:	write_debug(ptr[0], reg, 0);			\
 	}
 
-- 
2.21.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ