Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Dec 2019 02:44:01 +0000 (UTC)
From:      Ryan Libby <rlibby@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r355972 - in head: sbin/camcontrol sys/sys
Message-ID:  <201912210244.xBL2i1RF088422@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rlibby
Date: Sat Dec 21 02:44:00 2019
New Revision: 355972
URL: https://svnweb.freebsd.org/changeset/base/355972

Log:
  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

Modified:
  head/sbin/camcontrol/camcontrol.c
  head/sys/sys/ata.h

Modified: head/sbin/camcontrol/camcontrol.c
==============================================================================
--- head/sbin/camcontrol/camcontrol.c	Sat Dec 21 02:43:49 2019	(r355971)
+++ head/sbin/camcontrol/camcontrol.c	Sat Dec 21 02:44:00 2019	(r355972)
@@ -2355,7 +2355,7 @@ ataidentify(struct cam_device *device, int retry_count
 	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) {

Modified: head/sys/sys/ata.h
==============================================================================
--- head/sys/sys/ata.h	Sat Dec 21 02:43:49 2019	(r355971)
+++ head/sys/sys/ata.h	Sat Dec 21 02:44:00 2019	(r355972)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912210244.xBL2i1RF088422>