[v2,1/5] hdata/i2c: add __packed to the host_i2c_hdr structure

Message ID 1504163557-14432-2-git-send-email-cclaudio@linux.vnet.ibm.com
State Under Review
Headers show
Series
  • hdata/i2c: add support to i2c array version 2 in P9
Related show

Commit Message

Claudio Carvalho Aug. 31, 2017, 7:12 a.m.
This adds __packed to the host_i2c_hdr structure since it defines an
offset that refers to the beginning of the structure.

Fixes: 41dc3eb4495c451a405974570f604622a3f829ef
Signed-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com>
---
 hdata/i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/hdata/i2c.c b/hdata/i2c.c
index 9de6aa4..cc127d5 100644
--- a/hdata/i2c.c
+++ b/hdata/i2c.c
@@ -152,7 +152,7 @@  static bool is_zeros(const void *p, size_t size)
 struct host_i2c_hdr {
 	const struct HDIF_array_hdr hdr;
 	__be32 version;
-};
+} __packed;
 
 int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index,
 	struct dt_node *xscom)