git: 40d0f9e02b74 - main - asmc: print the last field of the SMC revision correctly
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 15 Nov 2026 21:21:47 UTC
The branch main has been updated by seuros:
URL: https://cgit.FreeBSD.org/src/commit/?id=40d0f9e02b746284a0bc4800f26e5b16f146f3b8
commit 40d0f9e02b746284a0bc4800f26e5b16f146f3b8
Author: Abdelkader Boudih <seuros@FreeBSD.org>
AuthorDate: 2026-11-15 21:12:39 +0000
Commit: Abdelkader Boudih <seuros@FreeBSD.org>
CommitDate: 2026-11-15 21:12:39 +0000
asmc: print the last field of the SMC revision correctly
Use be16dec() at the correct offset instead of an unaligned,
off-by-two-bytes read through a cast pointer.
MFC after: 3 days
Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D61479
---
sys/dev/asmc/asmc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sys/dev/asmc/asmc.c b/sys/dev/asmc/asmc.c
index e6b21c848e31..5a7735f4befa 100644
--- a/sys/dev/asmc/asmc.c
+++ b/sys/dev/asmc/asmc.c
@@ -469,8 +469,7 @@ asmc_init(device_t dev)
}
} else {
device_printf(dev, "SMC revision: %x.%x%x%x\n",
- buf[0], buf[1], buf[2],
- ntohs(*(uint16_t *)buf + 4));
+ buf[0], buf[1], buf[2], be16dec(buf + 4));
}
asmc_sysctl_add_platform(dev, sysctlctx);