git: 29d7e39f5690 - main - nvme: Bump the alignment of struct nvme_health_information_page to 8
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 07 May 2024 20:54:19 UTC
The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=29d7e39f5690af095b96ce2d3c9907423c7f5715 commit 29d7e39f5690af095b96ce2d3c9907423c7f5715 Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2024-05-07 20:48:06 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2024-05-07 20:54:00 +0000 nvme: Bump the alignment of struct nvme_health_information_page to 8 This ensures that embedded uint64_t values used for statistics counters are aligned when allocating a structure on the stack or as part of a containing structure. In particular this quiets -Waddress-of-packed-member warnings from GCC when compiling the code in nvmfd to update the stats. Reported by: GCC --- sys/dev/nvme/nvme.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index a4baade7df5d..6ef7a2bd8aad 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -1601,7 +1601,7 @@ struct nvme_health_information_page { uint32_t ttftmt2; uint8_t reserved2[280]; -} __packed __aligned(4); +} __packed __aligned(8); _Static_assert(sizeof(struct nvme_health_information_page) == 512, "bad size for nvme_health_information_page");