GCC 10.x reports:
oslib/linux-blkzoned.c: In function ‘blkzoned_report_zones’:
oslib/linux-blkzoned.c:146:18: warning: taking address of packed member of ‘struct blk_zone_report’ may result in an unaligned pointer value [-Waddress-of-packed-member]
146 | blkz = (void *) &hdr->zones[0];
which is totally fine, but we can easily avoid this warning by just
setting the 'blkz' pointer to the end of 'hdr'.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
}
nr_zones = hdr->nr_zones;
- blkz = &hdr->zones[0];
+ blkz = (void *) hdr + sizeof(*hdr);
z = &zones[0];
for (i = 0; i < nr_zones; i++, z++, blkz++) {
z->start = blkz->start << 9;