git: b68588618b43 - main - arm64: simplify expression
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 15 May 2023 15:57:14 UTC
The branch main has been updated by kevans:
URL: https://cgit.FreeBSD.org/src/commit/?id=b68588618b43720ca2950202491ddbd17599c260
commit b68588618b43720ca2950202491ddbd17599c260
Author: Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2023-05-15 15:54:15 +0000
Commit: Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2023-05-15 15:54:15 +0000
arm64: simplify expression
!a != !b -> a != b; this part was lifted from NetBSD, and I clearly did
not reconsider that these are bools (I'm guessing they were ints in an
earlier iteration of the NetBSD implementation).
while we're here, it should be easy to see that we've covered all of the
cases but let's add in an __assert_unreachable() to make it easier on
the eyes.
Reported by: jrtc27
---
sys/arm64/arm64/undefined.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sys/arm64/arm64/undefined.c b/sys/arm64/arm64/undefined.c
index 7f436aaef6e5..e1afca40f396 100644
--- a/sys/arm64/arm64/undefined.c
+++ b/sys/arm64/arm64/undefined.c
@@ -164,9 +164,11 @@ arm_cond_match(uint32_t insn, struct trapframe *frame)
case INSN_COND_AL:
match = true;
break;
+ default:
+ __assert_unreachable();
}
- return (!match != !invert);
+ return (match != invert);
}
#ifdef COMPAT_FREEBSD32