hdata/i2c: add __packed to the host_i2c_hdr structure

Message ID 1507784603-31795-1-git-send-email-cclaudio@linux.vnet.ibm.com
State Accepted
Headers show
Series
  • hdata/i2c: add __packed to the host_i2c_hdr structure
Related show

Commit Message

Claudio Carvalho Oct. 12, 2017, 5:03 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(-)

Comments

Stewart Smith Oct. 16, 2017, 8:13 a.m. | #1
Claudio Carvalho <cclaudio@linux.vnet.ibm.com> writes:

> 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(-)

Thanks!

Merged to master as of f0379b84b9088796d61287a3ab31bf5a54519df7

Patch

diff --git a/hdata/i2c.c b/hdata/i2c.c
index c7f38e9..2e14212 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)