Declare packed struct ata_params as 2-byte-aligned

This avoids gcc9 warning about unaligned access to the structure when
casting to uint16_t pointer type.

Submitted by:	imp
Reviewed by:	imp
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D22888
This commit is contained in:
Ryan Libby 2019-12-21 02:44:00 +00:00
parent fc41af14c8
commit 36947e1f4d
2 changed files with 2 additions and 2 deletions

View File

@ -2355,7 +2355,7 @@ ataidentify(struct cam_device *device, int retry_count, int timeout)
if (arglist & CAM_ARG_VERBOSE) {
printf("%s%d: Raw identify data:\n",
device->device_name, device->dev_unit_num);
dump_data((void*)ident_buf, sizeof(struct ata_params));
dump_data((uint16_t *)ident_buf, sizeof(struct ata_params));
}
if (ident_buf->support.command1 & ATA_SUPPORT_PROTECTED) {

View File

@ -311,7 +311,7 @@ struct ata_params {
/*223*/ u_int16_t transport_minor;
u_int16_t reserved224[31];
/*255*/ u_int16_t integrity;
} __packed;
} __packed __aligned(2);
/* ATA Dataset Management */
#define ATA_DSM_BLK_SIZE 512