git: 2ad93a4f6b03 - main - grackle badaddr: Use void casts instead of a dummy variable.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Tue, 12 Apr 2022 21:59:21 UTC
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=2ad93a4f6b034b18e3be98d1aa71d200da659f6c

commit 2ad93a4f6b034b18e3be98d1aa71d200da659f6c
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-04-12 21:58:58 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-04-12 21:58:58 +0000

    grackle badaddr: Use void casts instead of a dummy variable.
---
 sys/powerpc/powermac/grackle.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/sys/powerpc/powermac/grackle.c b/sys/powerpc/powermac/grackle.c
index d3eb9ded1736..06b5992e99a0 100644
--- a/sys/powerpc/powermac/grackle.c
+++ b/sys/powerpc/powermac/grackle.c
@@ -243,7 +243,6 @@ badaddr(void *addr, size_t size)
 {
 	struct thread	*td;
 	jmp_buf		env, *oldfaultbuf;
-	int		x;
 
 	/* Get rid of any stale machine checks that have been waiting.  */
 	__asm __volatile ("sync; isync");
@@ -262,13 +261,13 @@ badaddr(void *addr, size_t size)
 
 	switch (size) {
 	case 1:
-		x = *(volatile int8_t *)addr;
+		(void)*(volatile int8_t *)addr;
 		break;
 	case 2:
-		x = *(volatile int16_t *)addr;
+		(void)*(volatile int16_t *)addr;
 		break;
 	case 4:
-		x = *(volatile int32_t *)addr;
+		(void)*(volatile int32_t *)addr;
 		break;
 	default:
 		panic("badaddr: invalid size (%zd)", size);