From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chen Gang Subject: [PATCH] drivers: staging: lustre: lustre: include: add "__attribute__((packed))" for the related union Date: Sat, 18 Jan 2014 17:50:34 +0800 Message-ID: <52DA4E6A.1000308@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=CPpGnc7xWPuHdFuXQE5ge1cRA0zbi5hmff4M3VETiLU=; b=qWfSP0tANFGIiy9qBdIBXzZQtDJYhWMhHU6GEi1RkFkD/rMMUuwmLdaKB9hQixtcWo FRRWSxzwYIcxEORM+X+xNgmjzKJJBVcRRs6+PXsIXduPq30NAhNCyxOEETbL035fhMJD jnM7KpjeTU1gSltWyeQSyt3Z1fL9hYhqktGxKi+GilYwJ3zarac/MuIO/m2K7WvTfvge t2gUJlUf0AoqBdw5X3vSG6BoqubCgYThP8fd1i4bfRYlD4KljkK5i59Xwz8hVlc/praj ZNo9blBDZjvvmaCjZFetSMMq4tfOFL3i2tM9iW3oGvcglhCUFc3+5BtuQwbdcRL6IqD3 JMVA== List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: driverdev-devel-bounces@linuxdriverproject.org To: Greg KH , andreas.dilger@intel.com, bergwolf@gmail.com, jinshan.xiong@intel.com, oleg.drokin@intel.com, jacques-charles.lafoucriere@cea.fr Cc: devel@driverdev.osuosl.org, James Hogan , linux-metag@vger.kernel.org, "linux-kernel@vger.kernel.org" Unfortunately, not all compilers assumes the structures within a pack region also need be packed (e.g. metag), so need add a pack explicitly to satisfy all compilers. The related error (under metag with allmodconfig): CC [M] drivers/staging/lustre/lustre/lov/lov_pack.o drivers/staging/lustre/lustre/lov/lov_pack.c: In function 'lov_getstripe': drivers/staging/lustre/lustre/lov/lov_pack.c:630: error: duplicate case value drivers/staging/lustre/lustre/lov/lov_pack.c:630: error: previously used here And originally, all related code used "__attribute__((packed))", so still use it instead of '__packed'. Signed-off-by: Chen Gang --- drivers/staging/lustre/lustre/include/lustre/lustre_user.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h index 6b6c0240..0828b31 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h @@ -345,7 +345,7 @@ struct lov_user_md_v3 { /* LOV EA user data (host-endian) */ * lmm_objects, use when writing */ __u16 lmm_layout_gen; /* layout generation number * used when reading */ - }; + } __attribute__((packed)); char lmm_pool_name[LOV_MAXPOOLNAME]; /* pool name */ struct lov_user_ost_data_v1 lmm_objects[0]; /* per-stripe data */ } __attribute__((packed)); -- 1.7.11.7