From e8c636fe75d6b797d2fe151f8534dea7bbc6d1c2 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 16 Feb 2011 18:38:26 +0000 Subject: [PATCH] [hermon] Add missing __attribute__ (( packed )) On 64-bit builds, MLX_DECLARE_STRUCT() produces a structure that is always a multiple of 64 bits long, causing the HCR structure to be over-length by one dword. This in turn causes hermon_cmd() to write beyond the end of the HCR, which causes commands to fail. Reported-by: Itay Gazit Signed-off-by: Michael Brown --- src/drivers/infiniband/mlx_bitops.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/drivers/infiniband/mlx_bitops.h b/src/drivers/infiniband/mlx_bitops.h index 5215f9a8..0c3b5477 100644 --- a/src/drivers/infiniband/mlx_bitops.h +++ b/src/drivers/infiniband/mlx_bitops.h @@ -46,8 +46,8 @@ typedef unsigned char pseudo_bit_t; uint8_t bytes[ sizeof ( struct _structure ## _st ) / 8 ]; \ uint32_t dwords[ sizeof ( struct _structure ## _st ) / 32 ]; \ struct _structure ## _st *dummy[0]; \ - } u; \ - } + } __attribute__ (( packed )) u; \ + } __attribute__ (( packed )) /** Get pseudo_bit_t structure type from wrapper structure pointer */ #define MLX_PSEUDO_STRUCT( _ptr ) \