From 008d079f2e75504ef2884939147de368857b3857 Mon Sep 17 00:00:00 2001 From: jimharris Date: Tue, 18 Sep 2012 18:16:52 +0000 Subject: [PATCH] Add __aligned(4) to NVMe defined data structures. This fixes issue in nvmecontrol(8), where clang throws a cast-align warning when casting a __packed structure pointer to a uint32_t pointer as part of printing raw hex output. Reported by: dhw --- sys/dev/nvme/nvme.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index c9a5686402f8..2845753f4905 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -513,7 +513,7 @@ struct nvme_controller_data { /* bytes 3072-4095: vendor specific */ uint8_t reserved7[1024]; -} __packed; +} __packed __aligned(4); struct nvme_namespace_data { @@ -603,7 +603,7 @@ struct nvme_namespace_data { uint8_t reserved6[192]; uint8_t vendor_specific[3712]; -}; +} __packed __aligned(4); enum nvme_log_page { @@ -661,7 +661,7 @@ struct nvme_health_information_page { uint64_t num_error_info_log_entries[2]; uint8_t reserved2[320]; -} __packed; +} __packed __aligned(4); #define NVME_TEST_MAX_THREADS 128